Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Say I insall apache or mysql etc. on my ubuntu server.

Is it possible to get a report of what was installed and where? (say I want to delete the apache installation).

share|improve this question
you shouldn't be manually deleting something installed by a package management system (apt in this case). Let the package management solution remove it for you. – Zypher May 27 '10 at 18:22
zypher, didn't realize there was an un-install :) – Blankman May 27 '10 at 19:28
up vote 3 down vote accepted

have a look at /var/log/dpkg.log - any installed packet is listed there

dpkg -L $package

will show where he files went

share|improve this answer
FWIW, I prefer the longer mnemonic --listfiles – pjz May 27 '10 at 21:29
At least on Ubuntu 10.04 there's also /var/log/apt/history.log which is easier to read than /var/log/dpkg.log – Florian Diesch May 28 '10 at 0:40

You can see the content of an installed package by dpkg -L apache2, if the package name is apache2. You will see the files and directories. If the package is not installed, you can see it on

If you want the list of the installed packages (not the content), check dpkg -l '*apache*'|egrep "^ii"

share|improve this answer

The purge option in will remove all the files installed during the installation. In some cases it will ask to confirm if you want to keep some of the data used by the package. Directories which are no longer empty will be reported.

The directory /var/lib/dpkg/info has the installation files. The file name is the name of the package, with a variety of extensions for different purposes. The file with a .list extension lists the files and directories which make up the package.

Installations often involve dependencies which are automatically installed. Some tools will mark these files as automatically installed. The initial installation does not do this marking. Automatically removed packes are not purged, so some configuration is left behind. The command 'aptitude purge ~c' will purge any packages which are configured but uninstalled. To list these packages use the command 'aptitude search ~c'.

Using the file limit '!~M' will limit the package display to packages which are not installed as a result of a dependency. With few exceptions all libraries should be installed a a result of a dependency. It you believe a package is installed to support a dependency, you can manally mark it using the 'M' command in aptitude. If it is not require for a package, it will be marked for removal. The undo command 'ctrl-u' will undo this if you really want to keep it.

There are also tools such as deb-orphan which help in removing packages which are a result of dependencies.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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