List All Installed Packages with apt on Ubuntu

 

 

Apt is a command-line interface that allows you to perform actions such as installing new software packages, removing unnecessary software packages, updating the existing software packages, searching for specific software packages etc. on a Linux VPS running Debian as an operating system or a Debian-based Linux distributions like Ubuntu. In this tutorial, we will show you how to list all installed packages with apt on Ubuntu (show all installed software on your VPS)

If you’d like to list all installed packages on your CentOS VPS, then check our yum tutorial.

First of all, connect to your Linux server via SSH. To list the installed software packages on your machine you can use the following command:

sudo apt list --installed

The output of the command will be very similar to the following one, depending on which packages are currently installed:

Listing...
acl/xenial,now 2.2.52-3 amd64 [installed]
adduser/xenial,xenial,now 3.113+nmu3ubuntu4 all [installed]
apache2/xenial-updates,xenial-security,now 2.4.18-2ubuntu3.1 amd64 [installed]
apache2-bin/xenial-updates,xenial-security,now 2.4.18-2ubuntu3.1 amd64 [installed,automatic]
apache2-data/xenial-updates,xenial-updates,xenial-security,xenial-security,now 2.4.18-2ubuntu3.1 all [installed,automatic]
apache2-doc/xenial-updates,xenial-updates,xenial-security,xenial-security,now 2.4.18-2ubuntu3.1 all [installed]
apache2-utils/xenial-updates,xenial-security,now 2.4.18-2ubuntu3.1 amd64 [installed]
apparmor/xenial-updates,now 2.10.95-0ubuntu2.5 amd64 [installed,automatic]
apt/xenial-updates,now 1.2.19 amd64 [installed]
apt-utils/xenial-updates,now 1.2.19 amd64 [installed]
...

To easily read the entire output you can use the less program.

sudo apt list --installed | less

You can look for a specific package through the output using the grep program.

sudo apt list --installed | grep -i apache

The output from the above command will list all packages that include apache in their names.

apache2/xenial-updates,xenial-security,now 2.4.18-2ubuntu3.1 amd64 [installed]
apache2-bin/xenial-updates,xenial-security,now 2.4.18-2ubuntu3.1 amd64 [installed,automatic]
apache2-data/xenial-updates,xenial-updates,xenial-security,xenial-security,now 2.4.18-2ubuntu3.1 all [installed,automatic]
apache2-doc/xenial-updates,xenial-updates,xenial-security,xenial-security,now 2.4.18-2ubuntu3.1 all [installed]
apache2-utils/xenial-updates,xenial-security,now 2.4.18-2ubuntu3.1 amd64 [installed]
libapache2-mod-php/xenial,xenial,now 1:7.0+35ubuntu6 all [installed,automatic]
libapache2-mod-php7.0/xenial-updates,now 7.0.13-0ubuntu0.16.04.1 amd64 [installed,automatic]
libapache2-mod-security2/xenial,now 2.9.0-1 amd64 [installed]
libapache2-modsecurity/xenial,xenial,now 2.9.0-1 all [installed]

Apt supports patterns to match package names and options to list installed (--installed) packages, upgradeable (--upgradeable) packages or all available (--all-versions) package versions.

Another alternative that you can use to list the installed software packages on your Ubuntu VPS is the dpkg command.

sudo dpkg -l

The output of the command will provide you with information such as the name of the package, version, architecture and short description about the package. Of course, you can use the grep program again to search for a specific package.

sudo dpkg -l | grep -i apache

The output should look like the one below:

ii  apache2                       2.4.18-2ubuntu3.1                     amd64        Apache HTTP Server
ii  apache2-bin                   2.4.18-2ubuntu3.1                     amd64        Apache HTTP Server (modules and other binary files)
ii  apache2-data                  2.4.18-2ubuntu3.1                     all          Apache HTTP Server (common files)
ii  apache2-doc                   2.4.18-2ubuntu3.1                     all          Apache HTTP Server (on-site documentation)
ii  apache2-utils                 2.4.18-2ubuntu3.1                     amd64        Apache HTTP Server (utility programs for web servers)
rc  apache2.2-common              2.2.22-6ubuntu5.1                     amd64        Apache HTTP Server common files
ii  libapache2-mod-php            1:7.0+35ubuntu6                       all          server-side, HTML-embedded scripting language (Apache 2 module) (default)
rc  libapache2-mod-php5           5.5.9+dfsg-1ubuntu4.16                amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-php7.0         7.0.13-0ubuntu0.16.04.1               amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-security2      2.9.0-1                               amd64        Tighten web applications security for Apache
ii  libapache2-modsecurity        2.9.0-1                               all          Dummy transitional package
ii  libapr1:amd64                 1.5.2-3                               amd64        Apache Portable Runtime Library
ii  libaprutil1:amd64             1.5.4-1build1                         amd64        Apache Portable Runtime Utility Library
ii  libaprutil1-dbd-sqlite3:amd64 1.5.4-1build1                         amd64        Apache Portable Runtime Utility Library - SQLite3 Driver
ii  libaprutil1-ldap:amd64        1.5.4-1build1                         amd64        Apache Portable Runtime Utility Library - LDAP Driver

 

Source