Thursday, December 9, 2010


how to find out to  which package a file belongs.  A database is downloaded with the contents of all packages.  Apt-file searches it for you to show which package a file belongs to.

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 belongs

If 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-file to find the package name. This is done like this:
$ apt-file search filename
It 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-apt is 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-file keeps 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

No comments:

Post a Comment