How to List Installed Packages in Ubuntu

This article will learn how to list the installed packages on your Ubuntu system.

Did you know that thousands of packages are installed on your Ubuntu 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 system’s functionalities.

Knowing how to list installed packages on your Ubuntu system can come in handy if you need to reinstall your system or install the same packages on another machine.

List Installed Packages Using APT

APT is a built-in package manager in Ubuntu that helps you install, update, and remove packages from your Ubuntu system. Additionally, 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 --installedCode language: PHP (php)

This will display a list of all the packages that have been installed using apt. However, it will also list the packages installed as dependencies.

So, in addition to the applications you installed, you will have an extensive list of libraries and other packages that you did not install directly.

List Installed Packages in Ubuntu

The output displays the package names, installed versions, and architecture. Furthermore, you can pipe the output to less to make it simpler to read because the package list is long.

apt list --installed | lessCode language: PHP (php)

You can use the grep command to filter the output to see if a specific package is installed. For example, to see if the firefox package is installed on our machine, we may use the following command:

apt list --installed | grep -i firefoxCode language: PHP (php)
Check whether a package is installed in Ubuntu

Adding the -i option to the grep command ignores letter casing, allowing for a more comprehensive search.

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

apt show firefox
View information about a specific package in Ubuntu

List Installed Packages Using dpkg Command

The dpkg command is used to install, build, and remove packages in Debian and its derivates. In addition, the dpkg command with added -l option lists all installed packages on a system.

dpkg -l
List Installed Packages Using dpkg Command

As you can see, the output displays the package names, installed versions, and architecture.

To check whether a specific package is installed, run dpkg -l and pipe the command output to the grep command, followed by the package name.

dpkg -l | grep -i firefox
List installed packages with the dpkg command on Ubuntu

Again, adding the -i option to the grep command ignores letter casing, allowing for a more comprehensive search.

List Installed Snap Packages

Snap is an alternative package manager system. However, 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 listCode language: PHP (php)
List installed SNAP packages in Ubuntu

Count Installed Packages

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

dpkg -l | grep ii | wc -l
Count installed packages on Ubuntu

As you can see from the command output, there are 1921 packages currently installed on our Ubuntu system.

Conclusion

You should be able to list and filter installed packages on your Ubuntu system at this point. Feel free to leave a comment if you have any questions.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%