How to view all installed packages in terminal (Ubuntu)
Categories:
How to View All Installed Packages in Ubuntu Terminal
Learn various command-line methods to list and inspect all installed software packages on your Ubuntu system, using tools like apt, dpkg, and snap.
Managing software packages is a fundamental task for any Linux user. Whether you're troubleshooting, auditing your system, or simply curious about what's installed, knowing how to list all packages from the terminal is an essential skill. This article will guide you through several powerful command-line tools available in Ubuntu to achieve this, covering apt
, dpkg
, and snap
.
Understanding Ubuntu's Package Management
Ubuntu primarily uses the Advanced Package Tool (APT) system, which relies on .deb
packages. The dpkg
command is the low-level tool that handles individual .deb
packages, while apt
(and its older counterpart apt-get
) provides a higher-level interface for managing packages, including dependency resolution and repository interaction. Additionally, Ubuntu supports Snap packages, a universal packaging system that bundles applications and their dependencies.
flowchart TD A[User Request] --> B{Choose Package Manager} B --> C{APT (Debian Packages)} B --> D{DPKG (Individual .deb)} B --> E{Snap (Universal Packages)} C --> C1[apt list --installed] C --> C2[apt-cache pkgnames] D --> D1[dpkg -l] E --> E1[snap list] C1 --> F[Display List] C2 --> F D1 --> F E1 --> F
Flowchart of package listing methods in Ubuntu
Using apt
to List Installed Packages
The apt
command is the recommended tool for most package management operations in modern Ubuntu versions. It provides a user-friendly interface and combines functionalities from apt-get
and apt-cache
. To list all installed packages using apt
, you can use the list --installed
subcommand.
apt list --installed
List all installed packages using apt
This command will output a comprehensive list of all packages that are currently installed on your system, along with their versions. The output format is typically package-name/status version architecture
.
apt list --installed
to grep
to search for specific packages. For example, apt list --installed | grep firefox
will show if Firefox is installed.Using dpkg
for Detailed Package Information
The dpkg
command is the foundational tool for managing Debian packages. While apt
is higher-level, dpkg
gives you direct control over individual .deb
files and provides detailed information about installed packages. The -l
(list) option is used to display all installed packages.
dpkg -l
List all installed packages using dpkg
The output of dpkg -l
is more verbose than apt list --installed
. It includes columns for desired action, package status, package name, version, architecture, and a short description. The first two characters indicate the status:
ii
: installed (desired status is Install, current status is Installed)rc
: removed (desired status is Remove, but configuration files are still present)un
: not installed
This command is particularly useful for understanding the exact state of a package.
dpkg -l
, you can combine it with awk
and grep
: dpkg -l | grep '^ii' | awk '{print $2}'
.Listing Snap Packages
Snap is a universal packaging system developed by Canonical (the creators of Ubuntu). Snap packages are self-contained and work across various Linux distributions. If you have Snap applications installed, they won't appear in apt
or dpkg
lists. To view them, you need to use the snap
command.
snap list
List all installed Snap packages
This command will display a table showing the name, version, revision, tracking channel, publisher, and notes for all installed Snap packages. This is crucial for a complete overview of all software on your system, especially if you use applications like Spotify, VS Code, or Slack, which are often distributed as Snaps.
Combining and Filtering Results
Often, you'll want to combine these methods or filter the results to find specific information. Using grep
is invaluable for this. You can also redirect the output to a file for later review.
apt list --installed | grep 'gnome'
dpkg -l | grep 'apache'
snap list | grep 'code'
Examples of filtering package lists with grep
For a comprehensive list of all installed packages from all sources, you might need to run each command separately and combine their outputs, or write a small script to do so.
sudo
.