Linux

List All the Installed Packages in Ubuntu

August 12, 2009

Sometimes you just can’t remember what packages you’ve already installed, or what version you are currently running. Thankfully you can quickly find out this information from the command line.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$ dpkg --get-selections
acl                         install
acpi-support                install
acpid                       install
adduser                     install
alacarte                    install
alsa-base                   install
alsa-utils                  install
anacron                     install
apmd                        install
apparmor                    install
apparmor-utils              install
apport                      install
apport-gtk                  install
apt                         install
apt-transport-https         install
apt-utils                   install
apt-xapian-index            install
aptitude                    install
apturl                      install

You’ll find that there is far too much information returned by this command and the only way to find exactly what you need is to grep it with a specific query. So for example if you were looking to find out what Python packages you had installed on that system you could use this command:

1
2
3
4
5
6
7
8
9
10
$ dpkg --get-selections | grep python
libpython2.6                    install
python                          install
python-apport                   install
python-apt                      install
python-brlapi                   install
python-cairo                    install
python-central                  install
python-cups                     install
python-cupshelpers              install

If you read the man pages on dpkg you’ll find there are many other useful commands you utilize. If you’re trying to track down the location of a package you can use the following command:

1
2
3
4
5
6
7
8
$ dpkg -L firefox
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/firefox
/usr/share/doc/firefox/copyright
/usr/share/doc/firefox/changelog.Debian.gz

This will give you a good idea of where you need to look if you’re trying to find some config files.

Only registered users can comment.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.