It is often important to know how many packages are installed on your computer. You may not know it, but there are many packages installed on your computer. Many of them are pre-installed when you do a fresh install of your operating system. You may want to see and list these packages. In this article, you will learn how to list installed packages in the Ubuntu system. You will learn how to:

  • List installed packages with apt
  • List installed packages with dpkg-query
  • List recently installed packages
  • list the number of installed packages
  • List snap packages

For this process, we use the Terminal command line application. You can invoke the Terminal command line by pressing Ctrl+Alt+T.

Tip:

We have tested the procedures and commands on Ubuntu 20.04 and Ubuntu 22.04. In Debian and earlier Ubuntu versions, more or less the same procedure can be used.

List Installed Packages with apt

The apt package manager comes pre-installed with the Ubuntu system. Not only it helps with installing, updating, or removing the packages but also helps to list the installed packages on your system.

In order to list installed packages on your system, issue the following command in the Terminal:

$ apt list --installed

From the output of the above command, you will get a list of all the installed packages including the ones installed as dependencies. The output lists the installed packages’ names along with their versions.

List installed packages with apt

If you want to find the specific package from the list, you can do so with the following command in Terminal:

$ apt list --installed | grep <package>

For instance, to find out the ‘zoom’ package, the command would be:

$ apt list --installed | grep zoom

The output shows that zoom version 5.2.446620.0816 is installed on your system. If it was not installed, you would see the blank output.

Search for installed package

List Installed Packages with dpkg-query

With dpkg, you can install and remove packages in your Ubuntu system. You can also use it for listing the installed packages in your system. Contrary to apt command, it displays the output in a more user-friendly way. It displays the output in various columns which makes it a bit easier to understand.

In order to list installed packages on your system, issue the following command in the Terminal:

$ sudo dpkg-query -l

Use dpkg command to list packages that are installed on Debian and Ubuntu

The above output lists the installed packages along with the versions, architecture, and a short description.

If you want to find the specific package from the list, you can do with the following command in Terminal:

$ dpkg-query -l | grep <package>

For instance, to find out the ‘zoom’ package, the command would be:

$ dpkg-query -l | grep zoom

If the output returns the package name along with the version, it means the package is installed. Otherwise, you will receive the blank output.

Search installed package with dpkg command

List Recently Installed Packages

In some cases, you only want to list the recently installed packages. To do so, issue the following command in Terminal:

$ grep " install " /var/log/dpkg.log

Ubuntu installed packages log

Get a Count of Installed Packages

You can also find the number of packages installed in your system using the apt package manager. Issue the following command in Terminal in order to do so:

$ apt list --installed | grep -v "^Listing" | wc -l

This command will give you a quick count of the total number of packages installed in your system. The output in the below screenshot tells us there are currently 1716 packages installed in your Ubuntu system.

Count installed packages

The dpkg-query command also gives you a quick count of installed packages. To find how many packages are installed in your system, issue the following command in Terminal:

$ dpkg-query -l | tail -n +6 | awk '{print $1}' | sort | uniq –c

The output in the below screenshot tells us there are currently 1716 packages installed in your Ubuntu system while 1 package is removed but only has the configuration file left behind.

use dpkg-query command to count packages

List Snap Packages

The commands we have discussed so far do not list the installed snap packages. In order to list the installed snap packages, issue the following command in the Terminal:

$ snap list

List installed snap packages

In this article, we have explained some ways to list the installed packages in Ubuntu 20.04 LTS. We have explained how to list the packages that were installed by Debian’s package manager or those installed as snap packages. Additionally, listing the recently installed packages and getting a quick overview of all installed packages were also explained in this article.

How to List Installed Packages on Ubuntu 22.04

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn