How do I list the files installed by a deb package?

6

2

I'm an Ubuntu user and I install packages with the apt-get. For example:

sudo apt-get install hadoop-0.20

After I install the package, there will be files in /usr/bin, /usr/lib/hadoop etc. Are there any commands can show out where exactly the package installed its files?

CodingME

Posted 2012-07-27T08:13:33.707

Reputation: 163

Try the man pages of the apt command family. For example: man apt-get – None – 2012-07-27T08:16:56.390

Answers

7

Yes, use the dpkg command like

  dpkg -L hadoop-0.20

The converse question (finding the package providing a given file) is answered with e.g.

  dpkg -S /usr/include/gc/gc.h

Read more about Debian packaging related tools

PS. Ubuntu (and other Linux distributions, eg Mint) is a derivative of Debian.

Basile Starynkevitch

Posted 2012-07-27T08:13:33.707

Reputation: 1 022

2dpkg will not tell you about config files and/or files created by the postinst script if the package. If you need to be really sure you get all files if a package, you will also need to examine its packaging scripts. – tripleee – 2012-07-27T11:43:27.203

2

You can list the installed files for a package by passing the --listfile flag to dpkg. For example, if your package is actually named "hadoop-0.20" then:

dpkg --listfiles hadoop-0.20

CodeGnome

Posted 2012-07-27T08:13:33.707

Reputation: 1 841

Or in a shorter form dpkg -L as I already answered. – Basile Starynkevitch – 2012-07-27T08:48:16.970

1

What files are installed on your system varies from package to package. To be 100% sure you should take a look into the .deb package yourself. Download the package first.

First you need to extract the .deb archive:

ar vx mypackage.deb

Now this should result in three new files: debian-binary, control.tar.gz and data.tar.gz. You're interested in the last one.

Now you can extract it as well using tar:

tar xzvf data.tar.gz

Now you can browse the package content freely. Look for any makefiles, install scripts and such like to see where things gets installed.

user111228

Posted 2012-07-27T08:13:33.707

Reputation: