
Knowing what is installed on an Ubuntu system helps when you audit a server, move to a new machine, troubleshoot a dependency or free up disk space. Ubuntu software can come from several package systems at once: APT (.deb), Snap and sometimes Flatpak. This guide shows how to list installed packages with apt, dpkg and dpkg-query, how to search for a specific package, list only packages you installed yourself, see recent installs, include snaps and flatpaks, and export the list to reinstall elsewhere.
Quick answerRun apt list --installed. To check one package, use apt list --installed | grep nginx or dpkg -l nginx. For snaps, run snap list.
Method 1: apt list
apt list --installed
Each line shows the package name, repository, version and architecture, for example:
nginx/noble-updates,now 1.24.0-2ubuntu7 amd64 [installed]
[installed,automatic] means the package was installed as a dependency of something else. The output is long, so page through it or filter it:
apt list --installed | less
apt list --installed | grep -i php
apt list --installed 2>/dev/null | wc -l # count packages
The 2>/dev/null hides apt's warning that its output format may change in scripts.
Method 2: dpkg -l
dpkg -l
dpkg -l | grep -i mysql
dpkg -l nginx
Lines starting with ii are installed. rc means the package was removed but its configuration files remain; clean those up with sudo apt purge.
Method 3: dpkg-query (custom output)
For scripts and reports, choose exactly which fields to print:
dpkg-query -W -f='${Package}\t${Version}\n'
dpkg-query -W -f='${Installed-Size}\t${Package}\n' | sort -n | tail -20
The second command lists the 20 largest packages (size in KB), which is useful when a server is running out of disk space.
Check whether a specific package is installed
dpkg -s nginx | grep Status
apt policy nginx
dpkg -s prints Status: install ok installed if the package is present. apt policy also shows the installed version and the version available from your repositories.
List only packages you installed manually
apt-mark showmanual
This leaves out automatically installed dependencies. It also includes packages that were part of the original Ubuntu installation, so the list is longer than what you typed yourself. To see only what you installed with apt, check the history log:
grep " install " /var/log/dpkg.log
zgrep "Commandline: apt" /var/log/apt/history.log*
See recently installed packages
grep " install " /var/log/dpkg.log | tail -20
Older logs are rotated into compressed files such as dpkg.log.2.gz; use zgrep to search them.
List upgradable packages
sudo apt update
apt list --upgradable
Snap and Flatpak packages
Ubuntu installs some software, such as Firefox, as snaps, which do not appear in apt list:
snap list
flatpak list # if Flatpak is installed
Export the list and reinstall on another server
apt-mark showmanual > packages.txt
# on the new Ubuntu server:
sudo apt update
xargs -a packages.txt sudo apt install -y
This works best between servers running the same Ubuntu release. Packages from PPAs or third-party repositories need those repositories added first.
Graphical options
On Ubuntu Desktop, open App Center and click the Manage tab to see installed applications (snaps and, in recent releases, deb packages). For a complete view of every deb package, install Synaptic with sudo apt install synaptic and use the Installed status filter.
Frequently asked questions
How do I list all installed packages in Ubuntu?
Run apt list --installed or dpkg -l. Add snap list to include snap packages.
How do I check if a package is installed on Ubuntu?
Run dpkg -s packagename or apt list --installed packagename.
How many packages are installed on my system?
Run dpkg -l | grep -c '^ii' for deb packages, and snap list | tail -n +2 | wc -l for snaps.
What is the difference between apt list and dpkg -l?
Both read the same package database. apt list also shows the repository and whether a package was installed automatically; dpkg -l shows the package state flags and descriptions.


