
In this tutorial, we described how to list and filter installed packages on Debian system. 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 Debian system or you can re-install. This guide will help to check whether a specific package is installed, count of installed packages and check version of installed packages.
List Installed Packages
Apt is a package manager which have command-line interface to manage packages in Debian system. You can list installed packages using apt
command. For get list of installed packages on Debian, 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 Debian system or not, then run below command:
sudo apt list --installed | grep google-chrome
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 Debian 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 Debian system and export as a file using apt command. Execute the following command to export list of all installed packages on your Debian 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 Debian system.
Conclusion
You successfully learned how to list installed package and find specific installed package on your Debian system.
If you have any questions or suggestion, please leave a comment below.
Leave a Reply