Categories: TutorialsUbuntu

How to List Installed Packages on Ubuntu 22.04

Listing down all the installed packages is a very useful practice. It is mostly performed by system administrators. It gives a brief idea about the existing applications on your system. Listing packages on Ubuntu is useful, especially when you are migrating from one machine to another, or want to upgrade the applications. After listing the packages on Ubuntu, you can free up your system space by removing the unused packages from your system.

Outline:

How to List Installed Packages on Ubuntu 22.04

The installed packages can be retrieved through:

Method 1: List Installed Packages on Ubuntu 22.04 Using apt Package Manager

Ubuntu versions later than 14 come with the support of the apt package manager. It is the default package manager and can list down the installed applications on Ubuntu. Let’s check the options given below to get the list of installed packages.

Option 1: List Installed Packages

To get only the list of installed packages, use the apt list command alongside the –installed flag in the Terminal:

sudo apt list –installed

The –installed flag makes sure that Terminal only displays the installed packages on Ubuntu:

In the installed packages list, the:

  • [Installed] indicates that the package was installed from the official repository.
  • [Installed, automatic] refers to the applications installed alongside other applications.
  • [Installed, Local] indicates that the package was installed from an unofficial repository.

To get the list of installed packages with minimal output, simply pipe the command to get installed packages to the less command:

sudo apt list –installed | less

Option 2: List Available and Installed Packages on Ubuntu 22.04

To get the list of both available and installed packages on Ubuntu, simply run the apt list command:

sudo apt list

Option 3: List Upgradeable Installed Packages on Ubuntu 22.04

Alongside getting the list of installed packages, you can get the packages that can be upgraded. To get the list of upgradeable packages on Ubuntu, simply provide the –upgradeable flag to the apt list command:

sudo apt list –upgradable

Option 4: List a Specific Installed Package on Ubuntu 22.04

Provide the package name to the apt list command alongside the –installed flag to get the specified installed package on Ubuntu:

sudo apt list firefox –installed

Alternatively, you can combine the apt list command with the grep command to get the specified installed package on Ubuntu.

sudo apt list –installed | grep -i firefox

Alternatively, users can retrieve the specific installed package by providing the package name to the apt show command:

sudo apt show firefox

Option 5: List All Installed Packages Versions on Ubuntu 22.04

With the apt list command, you can get the versions of all the installed packages on Ubuntu. To get the installed package versions, specify the –all-versions flag to the apt list command:

sudo apt list –all-versions

Method 2: List Installed Packages on Ubuntu 22.04 Using dpkg

Ubuntu users can also get the list of installed packages on the system through the dpkg package manager. Check the guided options below to get the list of installed packages on Ubuntu through dpkg.

Option 1: List Installed Packages

To retrieve installed applications along with their versions on Ubuntu using the dpkg command, simply execute the below-given command:

sudo dpkg -l

Alternatively, you can also use the dpkg-query command to get the list of installed packages on Ubuntu 22.04. The dpkg-query command is more like an apt command. It was more common on older versions of Ubuntu which did not have the support of apt command back then. To retrieve installed packages, use the dpkg-query command as shown below:

sudo dpkg-query -l

Option 2: List a Specific Installed Package on Ubuntu 22.04

Any specific installed package on Ubuntu can be retrieved using the dpkg command when combined with the grep command. To get the specific installed package, first pipe the dpkg command alongside the -l flag to the grep command and then specify the package name:

Sponsored
sudo dpkg -l | grep firefox

Remember to replace the package name with your package name:

You can also get the specific installed package using the dpkg-query command. To get the specified installed package, execute the below command:

sudo dpkg-query -l | grep firefox

Method 3: List Installed Packages on Ubuntu 22.04 Using Snap

Another alternate method to get the installed packages is through the Snap package manager. This method only shows the packages installed through Snap.

To retrieve the installed applications on Ubuntu 22.04 through the snap utility, simply execute the given command:

sudo snap list

Method 4: List Installed Packages on Ubuntu 22.04 Using Synaptic Package Manager (GUI)

Once Synaptic Package Manager was the default package manager on Ubuntu, and it was possibly the best package manager on Linux. However, it can still be used on Ubuntu to manage applications, such as install, remove, and get the list of applications on Ubuntu.

Follow the guided steps given below to retrieve installed applications on Ubuntu 22.04.

Step 1: Install Synaptic Package Manager

Execute the below-mentioned command to install the Synaptic Package Manager on Ubuntu:

sudo apt install synaptic -y

Step 2: Launch Synaptic Package Manager

Once the Synaptic Package Manager is installed, click on the Show Applications button available in the left-bottom corner, search Synaptic and launch Synaptic Package Manager:

Enter the user password and hit the Authenticate button to launch it.

Step 3: List Installed Packages

After launching Synaptic Package Manager on Ubuntu, first, click on the Status button to get all the applications on Ubuntu. Then, click on the Installed button to only get the list of installed applications, as shown below:

Method 5: List Installed Packages on Ubuntu 22.04 Using the Ubuntu Software Store (GUI)

You can also get the list of installed packages through the Ubuntu Software application. Check the guided steps given below to get installed applications through the Ubuntu Software application.

  • Open the Ubuntu Software store via the left-screen application panel.
  • Move to the Installed section:

Bonus Tip 1: How to Create a List of Installed Packages on Ubuntu 22.04 Using dpkg-query

The dpkg-query command-line utility allows the users to save the installed packages list into the text file. To create an installed packages list, first, get the list of installed packages and then pipe them to the text file using the export sign > and specify the text file where the list of installed packages on Ubuntu 22.04 will be stored. Execute the given command to create the list of installed packages on Ubuntu 22.04:

dpkg-query -f ‘${binary:Package}n’ -W > list-debian-packages.txt

Remember to replace the text file with your text file:

Now, read the text file to verify whether the installed packages list was created or not. To read the text file provide the text file to the cat command and then pipe it to the head command to print the first lines of the text file:

cat list-debian-packages.txt | head

To install the saved packages on any Linux system, use the following command:

sudo xargs -a list-debian-packages.txt apt install

Bonus Tip 2: How to Count the Number of Installed Packages on Ubuntu 22.04

Alongside getting the installed applications, you can also count the total number of installed packages through the apt command line utility. To get the total number of installed packages on Ubuntu, first write the command to get the installed packages and then pipe it to the wc command (World Count) alongside the -l command to count the number of lines:

sudo apt list –installed | wc -l

Alternatively, you can also count the number of installed packages using the dpkg command, as shown below:

sudo dpkg -l | wc -l

Conclusion

Ubuntu lets you list down installed packages on your system. It lists down pre-installed, locally installed, and dependencies that depend on other applications on the system. The list of installed packages on Ubuntu can be retrieved through apt, dpkg, snap utility, and Ubuntu Software store. You can utilize any of the methods mentioned in the above section of this article to retrieve the list of applications installed on Ubuntu according to your preferences. Doing this will allow you to manage applications on your system and remove them to free up the disk space on the system.

Ubuntu Server Admin

Recent Posts

Building RAG with enterprise open source AI infrastructure

One of the most critical gaps in traditional Large Language Models (LLMs) is that they…

20 hours ago

Life at Canonical: Victoria Antipova’s perspective as a new joiner in Product Marketing

Canonical is continuously hiring new talent. Being a remote- first company, Canonical’s new joiners receive…

2 days ago

What is patching automation?

What is patching automation? With increasing numbers of vulnerabilities, there is a growing risk of…

3 days ago

A beginner’s tutorial for your first Machine Learning project using Charmed Kubeflow

Wouldn’t it be wonderful to wake up one day with a desire to explore AI…

4 days ago

Ubuntu brings comprehensive support to Azure Cobalt 100 VMs

Ubuntu and Ubuntu Pro supports Microsoft’s Azure Cobalt 100 Virtual Machines (VMs), powered by their…

4 days ago

Ubuntu Weekly Newsletter Issue 870

Welcome to the Ubuntu Weekly Newsletter, Issue 870 for the week of December 8 –…

5 days ago