Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

How can I get the list of all packages installed on my Debian system (I know this one is easy)? And also a list of all packages marked as manual? I am thinking about system upgrade, but I can't remember all these things I installed over the years :)

share|improve this question
up vote 9 down vote accepted

Getting the list of installed packages is simple:

dpkg --get-selections | grep "[[:space:]]install$" >  installed_pkgs

You can later reinstall the packages in the list using this command:

dpkg --set-selections < installed_pkgs
sudo apt-get -u dselect-upgrade

If you've used aptitude exclusively to manually install packages, it is very easy to get a nice list of manually installed packages. Otherwise, this list will include both packages you installed, and their dependencies.

In either case, read through this article and comments for a coherent solution to generating the list of manually installed packages: Cleaning up a Debian GNU/Linux system.

You might find deborphan and debfoster of help in maintaining this list in future.

share|improve this answer
    
deborphan among other things returns diff and other essential packages though - so I wouldn't really recommend using it. – Grzenio Nov 13 '09 at 8:02
dpkg -l

to list all installed packages.

share|improve this answer

Here's how I would do it. As root, run the following:

dpkg --get-selections | sed 's/\t.*//' > packages-list.txt

This will produce a nice, clean list of installed packages, perfect for using with apt-get install.

Or a crude way to get a list of the packages you have manually installed with aptitude you can grep the logs with something like

zcat /var/log/aptitude.* | grep INSTALL] && cat /var/log/aptitude| grep INSTALL]

(But beware, installs with aot-get or dpkg will not get recorded here, plus logrotate might have archived part of the log, which this method will not pick up!)

share|improve this answer

dpkg -l will list installed packages, as suggested.

I suggest to use upgrade-system for package upgrade, as it (wrapping deborphan) will purge away old un-needed packages too. This takes your system reasonably both up-to-date and clean.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .