apt-file is a tool which allows you to see what files contains a package in the repositories, without the need to necessarily install it. It also allows searching for files inside packages. To get it on Debian Lenny, type as root:
apt-get install apt-file
Next, update the cache:
This will take a while.
1. Search for a specific file in all the packages
apt-file search file_name
For example, try this:
apt-file search ogg123
ogg123 is a command line player for Ogg Vorbis included in the vorbis-tools package on Debian. However, if you don't know the exact name of the package but you know the tool's name (in this case, ogg123), you can search for it. Here's the output:
$ apt-file search ogg123
So you can see that the package vorbis-tools contains the binary which will get installed as /usr/bin/ogg123.
Using apt-file to search for a specific file without knowing the exact package name
2. List files in a given package
Let's try to list all the files which a specific package will install. Here are the first entries from the output of the command apt-file show vorbis-tools:
$ apt-file show vorbis-tools
3. Purge the cache
To purge the cache generated by apt-file update, use:
As root. You will have to create the cache again with apt-file update.
# apt-file purge
$ apt-file show amarok
E: The cache directory is empty. You need to run 'apt-file update' first.
For more details about apt-file, use the help and the manual page:
Updated: Jul 08, 2008 (Created: Jul 08, 2008)