list installed packages in debian

How to List All Installed Packages in Debian?

You may forget what software you have after installing packages in Debian. It happens to the best of us! Luckily, Debian offers several ways to easily list all your installed packages. This guide will walk you through three methods using the command line:

1. Using apt list

The apt command is the primary package management tool in Debian. It combines the functionalities of apt-get and apt-cache from earlier versions. To list installed packages with apt, use the following command:

apt list --installed

This command displays a list of all installed packages on your system, along with their versions and descriptions.

2. Using dpkg-query

dpkg-query is another helpful tool for querying the dpkg database, which stores information about installed packages. To list installed packages with dpkg-query, use the following command:

dpkg-query -l

This command also displays a list of installed packages, but it provides more detailed information, including the package size, architecture, and status.

3. Creating a Text File

If you want to create a text file containing the list of installed packages for future reference, you can use the following command:

dpkg-query -l | grep "install" > installed_packages.txt

This command uses the grep command to filter the output of dpkg-query and only select lines that contain the word “install”, ensuring you only get entries for installed packages. The output is then piped to the > redirection operator, which saves the filtered list to a file named “installed_packages.txt”.

Bonus Tip: Using wc -l Command

The wc -l command can be used to count the number of installed packages:

apt list --installed | wc -l

This will output the total number of installed packages on your system.

By following these methods, you can easily list installed packages on your Debian system, helping you keep track of your software and manage your system effectively.

Leave a Reply

Your email address will not be published. Required fields are marked.