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?
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
:apt-file
can tell you which files will be installed by a package before installing it:Or if you have the package as a
.deb
file locally already, you can rundpkg
on it:To find which package provides a file that is already on your system, use:
To find which package provides a file that is not currently on your system, use
apt-file
again:As far as I'm concerned, dpkg is the low-level tool that apt-get depends on.
Here is a function that should do it for you without the need to downloading the package to disk.
Then use
apt_list <package name1> [package name 2]
e.g.
apt_list curl wget
As for reverse checking files from packages apt-file would be the best bet.
If you have installed
dlocate
, you can usedlocate -L
the same way asdpkg -L
. It works exactly the same in this case, but has a number of other options.