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
- Bonus Tip 1: How to Create a List of Installed Packages on Ubuntu 22.04 Using dpkg-query
- Bonus Tip 2: How to Count the Number of Installed Packages on Ubuntu 22.04
- Conclusion
How to List Installed Packages on Ubuntu 22.04
The installed packages can be retrieved through:
- apt Package Manager
- dpkg Package Manager
- Snap Store
- Synaptic Package Manager (GUI)
- Ubuntu Software Store (GUI)
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:
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:
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:
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:
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:
Alternatively, you can combine the apt list command with the grep command to get the specified installed package on Ubuntu.
Alternatively, users can retrieve the specific installed package by providing the package name to the apt show command:
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:
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:
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:
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:
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:
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:
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:
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:
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:
To install the saved packages on any Linux system, use the following command:
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:
Alternatively, you can also count the number of installed packages using the dpkg command, as shown below:
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.