Share your love
How To List Installed Packages on Ubuntu

In this guide, we want to show you How To List or Display Installed Packages on Ubuntu.
Sometimes you may want to know how many packages are installed on your server. Many of them are pre-installed when you do a fresh install of your operating system.
To see what packages are installed on your Ubuntu server, follow the steps below.
Steps To List Installed Packages on Ubuntu
In this guide, you will learn to list your installed packages in different ways. For this purpose, log in to your Ubuntu server as a root or non-root user with sudo privileges.
You can follow our Initial guides on:
Initial Server Setup with Ubuntu 20.04
Initial Server Setup with Ubuntu 22.04
List Installed Packages with APT Repository
An APT repository is a collection of deb packages with metadata that is readable by the apt-* family of tools, namely, apt-get. Having an APT repository allows you to perform package installation, removal, upgrade, and other operations on individual packages or groups of packages.
You can use the apt to list your installed packages. To do this, run the command below:
apt list --installed
Example Output
Listing... Done
adduser/jammy,now 3.118ubuntu5 all [installed,automatic]
amd64-microcode/jammy,now 3.20191218.1ubuntu2 amd64 [installed,automatic]
apparmor/jammy-updates,now 3.0.4-2ubuntu2.1 amd64 [installed,automatic]
apport-symptoms/jammy,now 0.24 all [installed,automatic]
apport/jammy-updates,jammy-security,now 2.20.11-0ubuntu82.1 all [installed,automatic]
apt-utils/jammy-updates,now 2.4.8 amd64 [installed,automatic]
apt/jammy-updates,now 2.4.8 amd64 [installed,automatic]
base-files/jammy-updates,now 12ubuntu4.2 amd64 [installed]
base-passwd/jammy,now 3.5.52build1 amd64 [installed]
bash-completion/jammy,now 1:2.11-5ubuntu1 all [installed,automatic]
bash/jammy,now 5.1-6ubuntu1 amd64 [installed]
bc/jammy,now 1.07.1-3build1 amd64 [installed,automatic]
bcache-tools/jammy,now 1.0.8-4ubuntu3 amd64 [installed,automatic]
bind9-dnsutils/jammy-updates,jammy-security,now 1:9.18.1-1ubuntu1.2 amd64 [installed,automatic]
bind9-host/jammy-updates,jammy-security,now 1:9.18.1-1ubuntu1.2 amd64 [installed,automatic]
bind9-libs/jammy-updates,jammy-security,now 1:9.18.1-1ubuntu1.2 amd64 [installed,automatic]
binutils-common/jammy-updates,jammy-security,now 2.38-4ubuntu2 amd64 [installed,automatic]
binutils-x86-64-linux-gnu/jammy-updates,jammy-security,now 2.38-4ubuntu2 amd64 [installed,automatic]
binutils/jammy-updates,jammy-security,now 2.38-4ubuntu2 amd64 [installed,automatic]
bolt/jammy,now 0.9.2-1 amd64 [installed,automatic]
bsdextrautils/jammy,now 2.37.2-4ubuntu3 amd64 [installed,automatic]
....
Also, you can find a specific package that is installed on your Ubuntu server by using the following command:
apt list --installed | grep <package-name>
For example, find Python 3 by using the command below:
apt list --installed | grep python3
Example Output
libpython3-stdlib/jammy-updates,now 3.10.6-1~22.04 amd64 [installed,automatic]
libpython3.10-minimal/jammy-updates,jammy-security,now 3.10.6-1~22.04.1 amd64 [installed,automatic]
libpython3.10-stdlib/jammy-updates,jammy-security,now 3.10.6-1~22.04.1 amd64 [installed,automatic]
libpython3.10/jammy-updates,jammy-security,now 3.10.6-1~22.04.1 amd64 [installed,automatic]
python3-apport/jammy-updates,jammy-security,now 2.20.11-0ubuntu82.1 all [installed,automatic]
python3-apt/jammy-updates,now 2.3.0ubuntu2.1 amd64 [installed,automatic]
python3-attr/jammy,now 21.2.0-1 all [installed,automatic]
python3-automat/jammy,now 20.2.0-1 all [installed,automatic]
python3-babel/jammy,now 2.8.0+dfsg.1-7 all [installed,automatic]
python3-bcrypt/jammy,now 3.2.0-1build1 amd64 [installed,automatic]
...
List Installed Packages with dpkg-query Command
dpkg-query is a tool to show information about packages listed in the dpkg database.
To list the installed packages, you can use the following command:
dpkg-query -l
Example Output
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 adduser 3.118ubuntu5 >
ii amd64-microcode 3.20191218.1ubuntu2 >
ii apparmor 3.0.4-2ubuntu2.1 >
ii apport 2.20.11-0ubuntu82.1 >
ii apport-symptoms 0.24 >
ii apt 2.4.8 >
ii apt-utils 2.4.8 >
ii base-files 12ubuntu4.2 >
ii base-passwd 3.5.52build1 >
ii bash 5.1-6ubuntu1 >
ii bash-completion 1:2.11-5ubuntu1 >
ii bc 1.07.1-3build1 >
ii bcache-tools 1.0.8-4ubuntu3 >
ii bind9-dnsutils 1:9.18.1-1ubuntu1.2 >
ii bind9-host 1:9.18.1-1ubuntu1.2 >
ii bind9-libs:amd64 1:9.18.1-1ubuntu1.2 >
ii binutils 2.38-4ubuntu2 >
ii binutils-common:amd64 2.38-4ubuntu2 >
....
The above output lists the installed packages along with the versions, architecture, and a short description.
Also, you can find a specific package that is installed on your Ubuntu server by using the following command:
dpkg-query -l | grep <package>
For example, find Python 3 by using the command below:
dpkg-query -l | grep python3
Example Output
ii libpython3-stdlib:amd64 3.10.6-1~22.04 amd64 interactive high-level object-oriented language (default python3 version)
ii libpython3.10:amd64 3.10.6-1~22.04.1 amd64 Shared Python runtime library (version 3.10)
ii libpython3.10-minimal:amd64 3.10.6-1~22.04.1 amd64 Minimal subset of the Python language (version 3.10)
ii libpython3.10-stdlib:amd64 3.10.6-1~22.04.1 amd64 Interactive high-level object-oriented language (standard library, version 3.10)
ii python3 3.10.6-1~22.04 amd64 interactive high-level object-oriented language (default python3 version)
ii python3-apport 2.20.11-0ubuntu82.1 all Python 3 library for Apport crash report handling
ii python3-apt 2.3.0ubuntu2.1 amd64 Python 3 interface to libapt-pkg
ii python3-attr 21.2.0-1 all Attributes without boilerplate (Python 3)
ii python3-automat 20.2.0-1 all Self-service finite-state machines for the programmer on the go
ii python3-babel 2.8.0+dfsg.1-7 all tools for internationalizing Python applications - Python 3.x
....
Display Recently Installed Packages
If you install many packages on your server. You can use the following command to see the recently added packages on your Ubuntu server:
grep " install " /var/log/dpkg.log
Display the Number of Installed Packages on Ubuntu
At this point, you can easily find out how many packages are installed on your server.
To do this, run the following command:
apt list --installed | grep -v "^Listing" | wc -l
Example Output
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
629
also, you can use the dpkg-query command to get the number of installed packages:
dpkg-query -l | tail -n +6 | awk '{print $1}' | sort | uniq –c
List Snap Packages
Snaps are containerized software packages that are simple to create and install.
To find out the installed snap packages on your Ubuntu server, run the following command:
snap list
Example Output
Name Version Rev Tracking Publisher Notes
core20 20221027 1695 latest/stable canonical✓ base
lxd 5.0.1-9dcf35b 23541 5.0/stable/… canonical✓ -
snapd 2.57.5 17576 latest/stable canonical✓ snapd
Conclusion
At this point, you have learned to List Installed Packages on Ubuntu in different ways.
Hope you enjoy it.
You may be like these articles: