List all installed packages on Debian

Chưa phân loại
This tutorial will explain how to list installed packages on Debian, including all options to list the necessary packages. On LinuxHint was already explained how to uninstall packages in Debian, that article included a brief introduction to packages listing, now all options for listing packages will be explained using dpkg, dpkg-query and apt package managers.


Debian packages manager is dpkg, dpkg is the command we use to install, remove and manage Debian packages. To know how dpkg files are created you can check this article on the topic.

To do a simple full list of all packages installed in our Debian system run:

dpkg -l

As you see there are 4 columns displaying the program names, versions, architecture support and description.

A dpkg-query -l command will throw exactly the same output, two ways to get the same information on packages:

For a more comfortable view you can add the less parameter, run from the console:

dpkg-query -l | less

If we want to search for a specific .deb package and if it’s installed run:

dpkg -s <package> | grep Status


dpkg -s nano | grep Status

Then try with a package you know you don’t have, in my case ill use tomcat:

dpkg -s tomcat | grep Status

As you can see the first output says nano is installed, while the second says tomcat isn’t installed but available.

Now if we want to list the specific package with  the information provided with dpkg -l type:

dpkg -l <package>


dpkg -l nano

Again the dpkg-query equivalent will throw the same output

If you want to list all files belonging to a package type:

dpkg -L <filename>


dpkg -L nano

This command lists all files belonging to nano and it’s paths. We can have this information before installing the package, get a .deb package and try:

dpkg -c <.deb>

In this case dpkg -c shows the directories and files which will get installed with Teamviewer.

Now let’s find out the total number of packages installed in our device, run:

dpkg-query -f ‘${binary:Package}n’ -W | wc -l

dpkg-query allow us to export a list of installed packages which we can use later to reinstall the same software on a different device. To create a list of installed packages run:

dpkg-query -f ‘${binary:Package}n’ -W > inststalledPackages

Now try:

less inststalledPackages


Apt (Advanced Package Tool) is another packages manager available on Debian and Ubuntu based Linux distributions. Despite to find information on packages dpkg has advantages over apt, apt is better since it can resolve dependencies when installing software. But also apt can be useful to list packages and get information on them.

To get a list of installed packages with apt run:

apt list –installed

You can also add the less parameter to have a comfortable view, allowing to pass lines and pages easily.

apt list –installed | less

With apt we can also use grep to look for a specific package, on the console type:

apt list –installed | grep -i nano

You can ignore the warning, apt informs about the package’s presence.

If we want to list dependencies for a package with apt, type in the terminal:

apt-cache depends <program>

This output reveals Teamviewer’s dependencies.I hope you found this article on listing programs and their information on Debian and Ubuntu systems. As you see each program (dpkg, dpkg-query or apt) has it’s own advantages and disadvantages, while dpkg/dpkg-query allow us to gather more information apt can help where dpkg fails like dependencies.Keep following LinuxHint for more tips and updates on Linux.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

Add A Debian Repository

This article gives a brief introduction to Debian repositories and how to add them by editing the sources.list file and...

How to quickly set up your own VPN on Amazon EC2 instance in 30 minutes

OpenVPN is an open source VPN protocol that is used for secure internet communication. It can be used for remote access...

Configure Ubuntu 18.04 LTS as an Ubuntu Package Cache Server

If you’re running a lot of Ubuntu machines in your private network, then it is highly likely that many people will be...
Bài Viết

Bài Viết Mới Cập Nhật

Lý do tại sao bạn nên sử dụng proxy khi truy cập web đen

Các lỗi thường gặp khi sử dụng proxy và cách khắc phục chúng.

Tác động của việc sử dụng proxy đến tốc độ kết nối internet của bạn.

Các tiện ích và công cụ để quản lý proxy.

Các cách để kiểm tra tốc độ và độ ổn định của proxy.