Ubuntu tip: Getting information about your installed packages

1. Show the List of Installed Packages on Ubuntu :
The command we need to use is dpkg –get-selections, which will give us a list of all the currently installed packages.

    $ dpkg --get-selections
    adduser                                         install
    alsa-base                                       install
    alsa-utils                                      install
    apache2                                         install
    apache2-mpm-prefork                             install
    apache2-utils                                   install
    apache2.2-common                                install
    apt                                             install
    apt-utils                                       install

You can filter through grep to get results for the exact package you need. For instance, I wanted to see which php packages I had already installed through apt-get:

    dpkg --get-selections | grep php

    libapache2-mod-php5                             install
    php-db                                          install
    php-pear                                        install
    php-sqlite3                                     install
    php5                                            install
    php5-cli                                        install
    php5-common                                     install
    php5-gd                                         install
    php5-memcache                                   install
    php5-mysql                                      install
    php5-sqlite                                     install
    php5-sqlite3                                    install
    php5-xsl                                        install

2. How do I get a list of installed files from a package

To see all the files the package put onto your system, do this:

dpkg-query -L <package_name>


dpkg -L php5-gd

3. Get a list of installed Python modules



in a Python shell/prompt.

4. Find all packages installed with easy_install/pip

pip freeze

will output a list of installed packages and their versions. It also allows you to write those packages to a file that can later be used to set up a new environment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s