Debian

How to List Installed Packages on Debian 12

Debian 12 Bookworm is the latest series of Debian systems that comes up with advanced features, latest security patches and bug fixes. Like other Linux systems, it includes pre-installed packages that are unknown to the users. Keeping track of those installed packages on your Debian system is a useful task since it allows you to manage your system effectively. If you get the list of installed packages on Debian, you will be able to decide whether a specific package is needed or it’s better to remove it from the system to free up the disk space.

In this guide, you will learn:

How to List Installed Packages on Debian 12

Conclusion

How to List Installed Packages on Debian 12

In the Debian system, packages are managed by apt and dpkg package management tools that allow users to install packages on the systems. The apt package manager is a high-level tool that is easy to use and handles the dependency issue automatically. While the dpkg package manager is a low-level tool that works similar to apt but hard to understand for beginners who are new to Linux systems. However, in general apt relies on dpkg for the installation and removal of packages, thus they are linked to each other.

If you want to list the installed packages on Debian 12, you can use:

  • apt Package Manager
  • dpkg Package Manager
  • Synaptic Package Manager

How to List Installed Packages on Debian 12 Using apt Package Manager

The apt list is a powerful command that displays the list of packages which you can install on your Debian system. By adding the –installed flag with the apt list command, it will provide you with the list of packages that are installed on Debian 12 from the apt package manager:

apt list --installed

If you want to count the number of installed packages on Debian, you can use the apt list command in the following way:

apt list --installed | wc -l

To get the list of packages associated with a single package, you can pipe the apt list –installed command with grep command followed by the package_name:

apt list --installed | grep package_name

Besides using the apt list command on Debian 12, you can also get detailed information about a package using the apt show command followed by the package_name:

apt show package_name

How to List Installed Packages on Debian 12 Using dpkg Package Manager

If you want to get detailed information about the installed packages on Debian 12, you can use the dpkg-query command followed by the -l flag. It will display you the list of installed packages with their version and architecture.

dpkg-query -l

The information provided about the installed packages on Debian 12 using the dpkg-query command is long enough. If you want to quit it, simply press the Q button.

To get information about a specific package installed on Debian 12, you can pipe the dpkg-query command with the grep command followed by the package_name:

dpkg-query -l | grep xserver

If you don’t want to see any additional options like version and architecture, you can execute the dpkg-query command with -W flag:

dpkg-query -W

If you want to save the installed packages list on Debian 12, you can execute the following command:

dpkg-query -f '${binary:Package}\n' -W > debian_packages_list.txt

The above command will save the list of installed packages on Debian 12 in a text file debian_packages_list:

You can retrieve the information from the file using the cat command followed by the file name on Debian 12:

cat debian_packages_list.txt

If you want to install the packages on your other Linux server, just copy the file to the server, then open terminal and use the following command to install the packages:

sudo xargs -a debian_packages_list.txt apt install

To count the number of installed packages list on Debian 12, you can use the following dpkg-query command:

dpkg-query -f '${binary:Package}\n' -W | wc -l

How to List Installed Packages on Debian 12 Using Synaptic Package Manager

Synaptic package manager is a GUI tool that allows you to install, remove and manage packages on your Debian system. It is preinstalled on a Debian system, and you can open it on your desktop to get the list of installed packages. This can be done using the following steps:

Step 1: First open Synaptic Package Manager from the application menu:

Step 2: Then navigate to Status option:

Step 3: Go to Installed section:

There you will be able to see the installed packages on your Debian system with their installed versions and description:

Bonus Method: How to List Installed Packages on Debian 12 Using Snap Package Manager

Besides using apt and dpkg package manager for installation of packages on Debian 12, some users also use Snap Package Manager on their systems. Snap is an external package manager that can be installed from the apt repository. It makes the installation of packages simple as you only have to write the package name you want to install. It will handle the dependencies by itself and install them on your system automatically.

If you have used Snap Package manager on your Debian system, you can use the following command to list the installed packages from Snap on Debian 12:

snap list

Conclusion

Listing the installed packages on Debian 12 is a useful task since it lets you decide whether to keep the packages or delete them from the system. You can list the installed packages on Debian using the apt list or dpkg-query commands. These two commands can be used in different ways to retrieve information of all installed packages on the Debian system. Beside using the commands, you can also use the GUI tool Synaptic Package Manager to view the list of installed packages on Debian 12. A detailed instruction for each method is provided in the above sections of this guide. Check out those methods to manage packages on your Debian system effectively.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.