
It is always useful to you if you know which packages are installed on your system. You can install same packages on another system if you know how to check installed package on your current Ubuntu system or you can re-install. In this tutorial described how to list installed packages on Ubuntu, whether a specific package is installed, count of installed packages and check version of installed packages.
Instructions of this article apply for any Ubuntu based distribution, including Linux Mint, Kubuntu and Elementary OS.
List Installed Packages
In Ubuntu system apt is a package manager which have command-line interface to manage packages. You can list installed packages using apt
command. For get list of installed packages on Ubuntu, execute the following command in terminal:
sudo apt list --installed
In output it will show a list of installed packages along with the version and architecture of package as given below:

Generally, packages list will be long so it would better to see list using pipe and make output less
and easier to read:
sudo apt list --installed | less
If you want to find any specific package is installed or not, you can filter combine grep command along with the apt command. For example, if you want check Google Chrome is installed on your Ubuntu system or not, then run below command:
sudo apt list --installed | grep google-chrome
Output
google-chrome-stable/now 75.0.3770.100-1 amd64 [installed]
List Installed Packages with dpkg-query
You can easily check the installed package from the dpkg command database using dpkg-query
command. This command is useful for who are running older Ubuntu version. Run the below command to list all the installed packages:
sudo dpkg-query -l | less

From above output you can see version, description and architecture of the packages.
Also, same as apt, you can use grep
command to filter package with dpkg-query -l
command:
sudo dpkg-query -l | grep google-chrome
The output should show as below:
Output
google-chrome-stable/now 75.0.3770.100-1 amd64 [installed]
Export List of Installed Packages
You can list the installed package on your Ubuntu system and export as a file using apt command. Execute the following command to export list of all installed packages on your Ubuntu system:
sudo apt list --installed > installed_packages.txt
You also can export the installed packages using dpkg-query command as given below:
sudo dpkg-query -f '${binary:Package}\n' -W > installed_packages.txt
Now, you can use this exported file to install these packages to your another system. Run the below command to install those packages:
sudo xargs -a installed_packages.txt apt install
How to count number of packages installed
You can get count number of installed packages using the below command:
dpkg --list | wc --lines
It should show output as below:
Output
2008
In above output you can see 2008 packages installed on my Ubuntu system.
Conclusion
You successfully learned how to list installed package and find specific installed package on your Ubuntu system.
If you have any questions or suggestion, please leave a comment below.
Excelente explicación. Con el sudo dpkg -l > paquetes.txt también exportar los nombres de todos los paquetes instalados