How to list installed packages in Ubuntu

Did you know that there are thousands of packages installed on your Linux system? You might be wondering where these packages came from. A lot of your packages come pre-installed on a newly installed Linux system. You have probably also installed more packages over time to enhance the functionalities of the system.

Sometimes, you might wish to list the packages that are installed on your system. In this article, you will learn how to list the packages that are installed on your Ubuntu system. This article will cover how to:

  • List installed packages with the apt command
  • List installed packages with the dpkg command
  • List installed Snap Packages
  • Count installed packages

Note: We have run the commands and procedure mentioned in this article on Ubuntu 20.04.

We will use the command-line Terminal for executing the commands. To open the command line Terminal in Ubuntu, use the Ctrl+Alt+T keyboard shortcut.

List Installed Packages Using apt Command

Apt is a built-in package manager in Ubuntu that helps you install, update, and remove packages from your Ubuntu system. The apt command can be used to display the list of installed packages on your system. To use the apt command, open the Terminal using the Ctrl+Alt+T keyboard shortcut and run the following command:

apt list --installed

This command will list all the packages that have been installed on your system using the apt command and using the .deb files, as well as listing the packages installed as dependencies.

Listing... Done
accountsservice/focal,now 0.6.55-0ubuntu11 amd64 [installed,upgradable to: 0.6.55-0ubuntu12~20.04.1]
acl/focal,now 2.2.53-6 amd64 [installed,automatic]
acpi-support/focal,now 0.143 amd64 [installed,automatic]
acpid/focal,now 1:2.0.32-1ubuntu1 amd64 [installed,automatic]
adduser/focal,focal,now 3.118ubuntu2 all [installed,automatic]
adwaita-icon-theme/focal,focal,now 3.36.0-1ubuntu1 all [installed,upgradable to: 3.36.1-2ubuntu0.20.04.2]
aisleriot/focal,now 1:3.22.9-1 amd64 [installed,automatic]
alsa-base/focal,focal,now 1.0.25+dfsg-0ubuntu5 all [installed,automatic]
alsa-topology-conf/focal,focal,now 1.2.2-1 all [installed,automatic]
alsa-ucm-conf/focal,focal,now 1.2.2-1 all [installed,upgradable to: 1.2.2-1ubuntu0.1]
alsa-utils/focal,now 1.2.2-1ubuntu1 amd64 [installed,automatic]
amd64-microcode/focal,now 3.20191218.1ubuntu1 amd64 [installed,automatic]
anacron/focal,now 2.3-29 amd64 [installed,automatic]
apg/focal,now 2.2.3.dfsg.1-5 amd64 [installed,automatic]
...

The output displays the package names, along with the installed versions and the architecture.

To check whether a package is installed, run apt list --installed | grep package_name

Example:

apt list --installed | grep firefox
firefox-locale-en/focal-updates,focal-security,now 77.0.1+build1-0ubuntu0.20.04.1 amd64 [installed]
firefox/focal-updates,focal-security,now 77.0.1+build1-0ubuntu0.20.04.1 amd64 [installed,automatic]

To view information about a specific package, run apt show package_name

Example:

apt show firefox
Package: firefox
Version: 77.0.1+build1-0ubuntu0.20.04.1
Priority: optional
Section: web
Origin: Ubuntu
Maintainer: Ubuntu Mozilla Team <ubuntu-mozillateam@lists.ubuntu.com>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 205 MB
Provides: gnome-www-browser, iceweasel, www-browser
Depends: lsb-release, libatk1.0-0 (>= 1.12.4), libc6 (>= 2.30), libcairo-gobject2 (>= 1.10.0)...

List Installed Packages Using dpkg Command

Dpkg is used to install, build, and remove packages in Debian OS and its derivates. The dpkg-query command can be used to list all installed packages on a system.

Enter the following command in the Terminal to list all the installed packages on your system:

dpkg-query -l
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                       Version                         >
+++-==========================================-================================>
ii  accountsservice                            0.6.55-0ubuntu11                >
ii  acl                                        2.2.53-6                        >
ii  acpi-support                               0.143                           >
ii  acpid                                      1:2.0.32-1ubuntu1               >
ii  adduser                                    3.118ubuntu2                    >
ii  adwaita-icon-theme                         3.36.0-1ubuntu1                 >
ii  aisleriot                                  1:3.22.9-1                      >
ii  alsa-base                                  1.0.25+dfsg-0ubuntu5            >
ii  alsa-topology-conf                         1.2.2-1                         >
ii  alsa-ucm-conf                              1.2.2-1                         >
...

The output displays the package names, along with their installed versions and the architecture.

To check whether a specific package is installed, run dpkg-query -l package name

dpkg-query -l firefox
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version                        Architecture Description
+++-==============-==============================-============-======================================
ii  firefox        77.0.1+build1-0ubuntu0.20.04.1 amd64        Safe and easy web browser from Mozilla

List Installed Snap Packages

The apt and dpkg-query commands do not list the packages that are installed as snaps. You can list these separately with the snap command.

Run the following command in the Terminal to list all packages installed as snaps on your system:

snap list
Name               Version             Rev   Tracking         Publisher   Notes
core18             20200427            1754  latest/stable    canonical✓  base
gnome-3-34-1804    0+git.3009fc7       36    latest/stable/…  canonical✓  -
gtk-common-themes  0.1-36-gc75f853     1506  latest/stable/…  canonical✓  -
snap-store         3.36.0-80-g208fd61  467   latest/stable/…  canonical✓  -
snapd              2.45.1              8140  latest/stable    canonical✓  snapd
...

Count Installed Packages

Along with listing installed packages, you can also find out how many packages are installed on your system. To do so, use the following command in the Terminal:

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

That is all there is to it!

Leave a Reply

Your email address will not be published.