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?

migrated from stackoverflow.com Jul 28 '12 at 21:05

This question came from our site for professional and enthusiast programmers.

  • Try the man pages of the apt command family. For example: man apt-get – arkascha Jul 27 '12 at 8:16

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.

  • 2
    dpkg 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 Jul 27 '12 at 11:43

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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.