APT – How to List All Files Installed by an APT Package

aptdpkg

I have installed the package geoip-bin using the apt-get command:

sudo apt-get install geoip-bin

and I wanted to know the command line command to use this package.
But when I try to list the files that the geoip-bin package installs, to try and find the executable file, it's not listed in the dpkg -S output

% dpkg -S geoip-bin
geoip-bin: /usr/share/doc/geoip-bin/changelog.Debian.gz
geoip-bin: /usr/share/lintian/overrides/geoip-bin
geoip-bin: /usr/share/doc/geoip-bin
geoip-bin: /usr/share/doc/geoip-bin/copyright

After some research I learnt that this package installs a command/executable /usr/bin/geoiplookup. So at this point, I now know
the command, but for future purposes, I would like to know how to find out what files a package installs.

Doing a "reverse" file lookup with, dpkg -S shows that this file came from the geo-ip bin package.

% dpkg -S /usr/bin/geoiplookup
geoip-bin: /usr/bin/geoiplookup

I wondered if dpkg -S is not showing the file in the output because /usr/bin/geoiplookup is provided by one of the dependencies of geoip-bin. After querying the dependencies with e.g. apt-cache show geoip-bin and then recursively querying the files and sub-dependencies, I still was not able to list the files provided by the package geoip-bin.
How can I generate a full listing of the files installed by a package?

Best Answer

-L, --listfiles

dpkg -L package-name
Related Question