Show the List of Installed Packages on Ubuntu or DebianWhile working on the instructions for compiling MonoDevelop from source, I relied heavily on the dpkg and apt-cache commands to tell me what was already installed vs what packages were available in the repository. After completing that article it occurred to me that I should explain how to show what packages are currently installed… so here we are.The command we need to use is dpkg –get-selections, which will give us a list of all the currently installed packages.$ dpkg –get-selectionsadduser installalsa-base installalsa-utils installapache2 installapache2-mpm-prefork installapache2-utils installapache2.2-common installapt installapt-utils installThe full list can be long and unwieldy, so it’s much easier to 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 phplibapache2-mod-php5 installphp-db installphp-pear installphp-sqlite3 installphp5 installphp5-cli installphp5-common installphp5-gd installphp5-memcache installphp5-mysql installphp5-sqlite installphp5-sqlite3 installphp5-xsl installFor extra credit, you can find the locations of the files within a package from the list by using the dpkg -L command, such as:dpkg -L php5-gd/./usr/usr/lib/usr/lib/php5/usr/lib/php5/20060613/usr/lib/php5/20060613/ I can take a look at the gd.ini file and change some settings around…

Show the List of Installed Packages on Ubuntu or Debian – How-To Geek.