this document is marked obsolete, but contains a good description of apt-file for now. It is copied below in the case the the debian site removes it at some time.
5.4 How to discover to which package a file belongsIf you want to install a package, and you can't find out what it is called by searching with
apt-cache, but know the filename of the program itself, or some other filename that belongs to the package, then you can use
apt-fileto find the package name. This is done like this:
$ apt-file search filenameIt works just like dpkg -S, but will also show you uninstalled packages that contain the file. It could also be used to find what packages contain necessary include files that are missing when compiling programs, although
auto-aptis a much better method of solving such issues, see How to install packages "on demand", Section 5.3.
You can also list the contents of a package, by running:
$ apt-file list packagename
apt-filekeeps a database of which files all packages contain, just like auto-apt does and it needs to be up-to-date. This is done by running:
# apt-file update