In this guide, you will learn how to list installed packages on Ubuntu using APT, the default package manager on Debian-based distributions.

Get a List of Installed Packages on Ubuntu

To output a list of packages that are currently installed, are upgradeable, or available on Ubuntu, you can use the list method of the APT command. To only print packages installed on your system, specify the –installed flag with the command.

Output:

The output generated by the aforementioned command contains additional information, including the version number and package state.

To get a clean output suitable for use in scripts and output transfer, you can use string manipulation tools like sed or awk. For example, to print only the package names:

Output:

You can also count the total number of packages. All you have to do is pipe the output of the aforementioned command with wc. Word count, abbreviated wc, is a Linux utility that counts the number of characters, words, or lines present in a text file.

Output:

As you can see in the output above, 2177 Linux packages are currently installed on the system.

Using dpkg-query

Users running older versions of Ubuntu can use the dpkg-query command to get a list of installed packages.

Dpkg will present the output in a clean, tabular format by default.

To strip out additional information and print only the names of the packages, run the following command:

Output:

Learn More: What Is the Difference Between APT and dpkg in Ubuntu?

Package Management Made Effortless With APT

In addition to the list method, APT has several other functions that provide information associated with Linux packages. It also takes away the headache of removing unnecessary dependencies by keeping records of installed and uninstalled packages on your system.

Like APT, several other package managers are available for Linux, including DNF, pacman, and YUM. Most Debian-based distros ship with APT, while Arch Linux and RHEL-based systems use pacman and DNF as their default package managers respectively.