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:
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.
The output displays the package names, along with the installed versions and the architecture.
To check whether a package is installed, run the following command:
To view information about a specific package, run the following command:
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:
The output displays the package names, along with their installed versions and the architecture.
To check whether a specific package is installed, run the following command:
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:
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:
That is all there is to it!
In this article, you learned how to list installed packages on your Ubuntu 20.04 system. You also learned how to check whether a particular package is installed, and how to get a quick count of the installed packages.