How do I get a list of files that were or will-be installed when I apt-get a package? Conversely, can I find what package(s) caused a particular file to be installed?
Note: in the following commands, a command beginning with 'root#' means it needs to be run as root.
To find which files were installed by a package, use
$ dpkg -L $package
apt-file can tell you which files will be installed by a package before installing it:
root# apt-get install apt-file root# apt-file update $ apt-file list $package
Or if you have the package as a
.deb file locally already, you can run
dpkg on it:
$ dpkg --contents $package.deb
To find which package provides a file that is already on your system, use:
$ dpkg -S /path/to/file
To find which package provides a file that is not currently on your system, use
$ apt-file search /path/to/file
dpkg -S /path/to/file/in/question
As far as I'm concerned, dpkg is the low-level tool that apt-get depends on.
If you have installed
dlocate, you can use
dlocate -L the same way as
dpkg -L. It works exactly the same in this case, but has a number of other options.