Subscribe to How-To Geek

Recommended: Click Here to Run a Free Scan for Common PC Errors   [Sponsored Link]

See Where a Package is Installed on Ubuntu

Once you use the apt-get utility to install a package, sometimes it seems to disappear into nowhere. You know it's installed, you just have no idea where.

If you know the name of the executable, you can use the which command to find the location of the binary, but that doesn't give you information on where the supporting files might be located.

There's an easy way to see the locations of all the files installed as part of the package, using the dpkg utility.

dpkg -L <packagename>

Example: I had installed davfs2, but I wasn't sure where the configuration file was, so I ran this command:

geek@ubuntuServ:~$ dpkg -L davfs2

davfs2: /usr/share/lintian/overrides/davfs2
davfs2: /usr/share/davfs2/GPL
davfs2: /usr/share/doc/davfs2/BUGS
davfs2: /usr/share/doc/davfs2/copyright
davfs2: /usr/share/davfs2/NEWS
davfs2: /usr/share/doc/davfs2/THANKS
davfs2: /usr/share/doc/davfs2/NEWS.gz
davfs2: /usr/share/doc/davfs2/README.gz
davfs2: /usr/share/doc/davfs2
davfs2: /usr/share/doc/davfs2/TODO
davfs2: /etc/davfs2/secrets
davfs2: /usr/share/davfs2/THANKS
davfs2: /usr/share/doc/davfs2/README.Debian
davfs2: /usr/share/davfs2/BUGS
davfs2: /etc/davfs2/davfs2.conf
davfs2: /usr/share/davfs2/ChangeLog
davfs2: /usr/share/davfs2/FAQ
davfs2: /etc/davfs2
davfs2: /usr/share/doc/davfs2/changelog.Debian.gz
davfs2: /usr/share/davfs2/secrets.template
davfs2: /usr/share/doc/davfs2/changelog.gz
davfs2: /usr/share/davfs2/TODO
davfs2: /usr/share/davfs2/davfs2.conf.template
davfs2: /usr/share/davfs2/README
davfs2: /usr/share/davfs2
davfs2: /usr/share/doc/davfs2/FAQ

Well, now I don't have to wonder anymore. The conf file is clearly  /etc/davfs2/davfs2.conf. If I wanted to see just what files were installed into /etc, you could always grep the output like this:

geek@ubuntuServ:~$ dpkg -L davfs2 | grep etc

davfs2: /etc/davfs2/secrets
davfs2: /etc/davfs2/davfs2.conf
davfs2: /etc/davfs2

Even easier to read.

Update: Changed from -S to -L thanks to a tip from sebest.

The Geek is the founder of How-To Geek and a geek enthusiast. When he's not coming up with great how-to articles, he's probably writing at his personal blog. This article was written on 12/16/06 and tagged with: Ubuntu, Adding Software, Ubuntu Tips & Tweaks

Comments (1)

  1. sebest

    dpkg -S doesn't display the content of a package, but search of a string in all installed package.

    but dpkg -L will list all the files in a package


Leave a Comment




Leave your friendly comment here. If you have a computer help question, leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Copyright © 2006-2008 HowToGeek.com. All Rights Reserved.