howtouselinux

5 ways to list installed packages in Linux

Table of Contents

Do you ever need to know what packages are installed on your Linux system? Maybe you’re troubleshooting a problem and need to identify a package that’s causing an issue. Or, maybe you want to install a new package and want to make sure there are no conflicts.

In any case, it’s helpful to know how to list installed packages in Linux. In this blog post, we will discuss 5 different ways to do just that!

  • apt list – -installed
  • dpkt -l
  • rpm -qa
  • yum list installed
  • dnf list installed

 

use apt command to list installed packages in Linux

The first way to list installed packages in Linux is to use the apt command. This command is used for package management in Debian and Ubuntu systems. To use it, simply type apt list – -installed into your terminal. This will list all of the installed packages on your system.

apt list – -installed
Listing… Done
accountsservice/focal-updates,focal-security,now 0.6.55-0ubuntu12~20.04.5 amd64 [installed,automatic]
acpid/focal,now 1:2.0.32-1ubuntu1 amd64 [installed]
adduser/focal,now 3.118ubuntu2 all [installed,automatic]

If you’re using an Ubuntu system, the apt command can be used to install, remove, and update packages. apt is the command that is being recommended by the Linux distributions. It provides the necessary option to manage the packages. Most important of all, it is easier to use with its fewer but easy to remember options.

The apt command has a number of different options that you can use. For example, you can use the “apt list –upgradable” option to list all of the packages on your system that can be upgraded.

You can also use the “apt search” option to search for a specific package. Simply type “apt search <package name>” into your terminal and it will search for the package name that you specify.

If you want to see a description of a certain package, you can use the “apt show <package name>” option. This will show you the description of the package and any other information that is available.

Finally, if you want to uninstall a package, you can use the “apt remove <package name>” option.

use dpkg command to list installed packages in Linux

Another way to list installed packages in Linux is to use the dpkg command. dpkg is a package manager for Debian, Ubuntu and many other Linux distro. It is used to install/manage individual packages. 

To use it, type “dpkg -l” into your terminal. This will list all of the installed packages on your system, as well as information about each package such as its version number and status.

If you want to see a more detailed list of installed packages, you can use the “dpkg -L <package_name>” command. This will show you information about the specified package, List individual installed packages, along with package version and short description

difference between apt and dpkg

APT Uses dpkg to Install Packages in the backend. With APT, you can retrieve a file from a remote repository and install it, all in one command. This saves you from the work of manually finding and downloading the package before installation.

With dpkg, you can only install local files you’ve already downloaded yourself. It can’t search remote repositories or pull packages from them

use rpm command to list installed packages in Linux

The third way to list installed packages in Linux is to use the rpm command. This command is used for package management on Red Hat and CentOS systems. To use it, type “rpm -qa” into your terminal. This will list all of the installed packages on your system, including their version numbers and dependencies.

If you want to see a more detailed list of installed packages, you can use the “rpm -ql <package_name>” command. This will show you information about the specified package, including its location on your system and the files that it contains.

use yum command to list installed packages in Linux

The fourth way to list installed packages in Linux is to use the yum command. This command is used for package management on Fedora and CentOS systems. To use it, type “yum list installed” into your terminal. 

If you want to see a more detailed list of installed packages, you can use the “yum info <package_name>” command. This will show you information about the specified package, including its location on your system and the files that it contains

difference between rpm and yum

The main difference between RPM and YUM is that RPM is the package manager for Red Hat based distributions while YUM stands for Yellow dog Updater, Modified is the software updater for both Red Hat Enterprise Linux (RHEL) and CentOS.

YUM was created to manage the dependencies while installing the RPM files and to automatically download the required RPM files from their online repositories.

RPM command can not install packages from online repositories.

use dnf command to list installed packages in Linux

The dnf command is the successor to yum and can also be used to list installed packages in Linux. To use it, type “dnf list installed” into your terminal.

As you can see, there are a few different ways to list installed packages in Linux. Which method you use will depend on your particular system. But, now that you know how, it should be a breeze! Try out each of these methods and see which one works best for you.

Do you have a preferred method for listing installed packages in Linux? Let us know in the comments below! And, as always, thanks for reading!

David Cao
David Cao

Hey there! I am David, a Cloud & DevOps Enthusiast and 18 years of experience as a Linux engineer. I work with AWS, Git & GitHub, Linux, Python, Ansible, and Bash. I am a technical blogger and a Software Engineer, enjoy sharing my learning and contributing to open-source.