The “Package” in Linux is also known as the “Application Software”. Users can install these packages from official and unofficial (using repositories) sources. While installing a package, users find it necessary to check if the application software is already installed in the system. Or while moving on to a new system, finding the packages on the system is often required.

Debian 12 offers a vast variety of command-line tools to list the installed packages, which are illustrated in this detailed guide.

How to List Packages/Applications Installed in Debian 12

To output a list of the packages/applications installed on the Debian 12 OS, use the following approaches:

apt list Command

The “apt” command installs the packages/applications on Debian-based distributions. It can also display the installed packages/applications. To view the packages/applications installed in Debian 12, use the “apt” command as follows to view a gigantic list of packages/applications on your system:

apt list

Save packages/Applications List to a File Using the “apt” Command

You can share your system’s packages/applications list with other users via a .txt file, which you can create using this command:

apt list > listapt.txt

The above command generates a list of installed packages/applications on Debian 12 and then outputs them to the file “listapt.txt”.

How to List the Last Ten Packages/Applications on Debian 12 Via the “apt” Command?

To list the last ten packages/applications in your system, use the following command:

apt list | tail

Note: Use the “head” instead of the “tail” command to list the first ten packages/applications.

How to List a Specific Package on Debian 12 Utilizing the “apt” Command?

To list a specific package, use the following format of the “apt” command:

apt list <package-name> --installed

The above snippet displays the installed version of Python. It also outputs the “[installed,automatic]” at the end. This indicates that the non-standard installation process in which, the package wasn’t included in the default software list or automatic updates 

It can also display “[installed,automatic]”, which means the package is automatically installed as a dependency for another package.

How to View the Total Number of packages/Applications Installed on Debian 12 Using the “apt” Command?

You can view the total number of packages/applications implicitly installed along with their dependencies using the “apt” command as follows:

apt-cache pkgnames | wc -l

dpkg Command

The “dpkg” is the command-line utility to manage the packages/applications on the Debian-based distribution. It can also list the installed packages/applications and provide the basic information (name, version, architecture, description). It is quite similar to the “apt list” command but outputs fewer details. It shows all installed applications unlike the “apt list” command which only displays the applications installed using the “apt database”

 To list the installed packages/applications on Debian 12, use the “dpkg” command as follows:

dpkg -l

How to List the Last Ten Installed packages/Applications Using the “dpkg” Command on Debian 12

To list the last ten packages/applications using the “dpkg” command on Debian 12, run the following command:

dpkg --get-selections | tail

Note: Use the “head” command to list the first ten packages/applications installed on your system.

How to List Installed packages/Applications According to the Provided Word Using the “dpkg” Command

If you want to list the installed packages/applications that start with a specific keyword; for instance, the installed packages/applications whose name starts with “a” are listed as follows:

dpkg --list 'a*'

In the above output, 

  • The “un” from the first column displays that the package is unknown and not installed on the system. But the configuration files are there.
  • The “ii” via the first column tells that the package is already installed in the current system.

List and Clone the Installed packages/Applications Using the “dpkg” Command in Debian 12

The “dpkg” command features the flags using which you can clone the installed packages/applications and their state to another system. To do that, run the following commands:

dpkg --get-selections > list.txt #Clone the Installed Packages
dpkg --clear-selections #Set the Request Stage on Another System
sudo dpkg --set-selections < list.txt #Set the Selection Stage on Another System
sudo apt-get -u dselect-upgrade #Install the Cloned Packages on Another System

aptitude Command

The “aptitude” command is a handy command-line utility that interacts with Debian’s package manager. It displays the “Installed Packages”, “Not Installed Packages”, “Virtual Packages” and “Tasks” as well. To invoke it, run the following command and use the arrow keys to select and view the required output:

aptitude

How to List Installed Packages/Applications and Their Description on Debian 12?

To get a list of all the packages/applications or utilities installed on your Debian system with their description on Debian 12, use the below-stated command:

aptitude search '~i!~M'

dctrl-tools

The “dctrl-tools” is the command-line utility that can list the installed packages/applications on Debian 12. To install it, use the following command:

sudo apt install dctrl-tools

After installing the “dctrl-tools”, execute the below command to find the installed packages/applications on your system:

grep-status -FStatus -sPackage -n "install ok installed"

Synaptic Package Manager

It is a graphical tool that enables you to manage the apt. It lets you view, install, and update the packages/applications on Debian-based distributions. To view a list of installed packages/applications on Debian 12, search and launch the “Synaptic Package Manager” from the “Activities”. From here, you can view the “Installed”, “Installed (manual)”, and “Not installed” packages/applications on the system. It also outputs the description of the selected package:

Snap Package Manager

Some packages/applications are installed via the “snap” package manager. To list such packages/applications, use the below-stated command:

snap list

How to List Installed Packages/Applications With Date and Time on Debian 12?

The “/var/log/dpkg.log” file hosts the complete information about the packages/applications installed on the system. It also logs the timestamps for package installations. To view such details, run the below command:

zgrep " installed " /var/log/dpkg.log*

flatpak list Command

To list the applications that you have installed via the flatpak, use the following command:

flatpak list --app

You can find more details about the flatpak applications along with their version information using the below command:

flathub list

To view all the details, including the architecture and size of the flatpak apps, use the below command:

flatpak list --show-details

That’s all for this detailed guide to list the packages/applications installed in Debian 12.

Final Words

The “Packages” are the applications installed on a Linux system. Users often find themselves confused while looking for the packages/applications installed in the system. To view a list of all the packages/applications installed in Debian 12, use the “apt list” or “dpkg –list” commands.

Additionally, users can use the “Synaptic Package Manager” or the “/var/log/dpkg.log” to view more detailed information. The packages/applications installed that are installed via the “snap” store are listed using the “snap list” command. This guide has explained all methods to view a list of all the packages/applications installed in Debian 12.