How to list all installed packages in CentOS or Redhat Linux?

You can list all installed packages in CentOS or Red Hat Enterprise Linux (RHEL) by using the rpm command with the -qa option.

For example, to list all installed packages in a long format, you can use the following command:

$ rpm -qa

This will list the names and versions of all installed packages on your system.

You can also use the yum command to list all installed packages. The yum command is a front-end to the rpm command, and it provides additional functionality for managing packages in CentOS or RHEL.

To list all installed packages with yum, you can use the list subcommand with the installed option. For example:

$ yum list installed

This will list the names and versions of all installed packages on your system.

You can also use the dnf command to list all installed packages in CentOS or RHEL. The dnf command is a newer package manager that is used in place of yum in some newer versions of CentOS and RHEL.

To list all installed packages with dnf, you can use the list subcommand with the installed option. For example:

$ dnf list installed

This will list the names and versions of all installed packages on your system.

Here are some additional ways to list installed packages in CentOS or Red Hat Enterprise Linux (RHEL):

  1. You can use the rpm command with the -qa option and the --queryformat option to list selected information about all installed packages. For example, to list the package names and descriptions of all installed packages, you can use the following command:
$ rpm -qa --queryformat '%{NAME} %{SUMMARY}\n'
  1. You can use the yum command with the list subcommand and the installed option to list all installed packages in a shorter format. For example:
$ yum list installed

This will list the names of all installed packages on your system, without the version numbers.

  1. You can use the yum command with the repoquery subcommand to list all installed packages and their version numbers. For example:
$ yum repoquery --installed
  1. You can use the yum command with the repoquery subcommand and the --queryformat option to list selected information about all installed packages. For example, to list the package names and descriptions of all installed packages, you can use the following command:
$ yum repoquery --queryformat '%{NAME} %{SUMMARY}\n' --installed
  1. You can use the dnf command with the list subcommand and the installed option to list all installed packages in a shorter format. For example:
$ dnf list installed

This will list the names of all installed packages on your system, without the version numbers.

  1. You can use the dnf command with the repoquery subcommand to list all installed packages and their version numbers. For example:
$ dnf repoquery --installed
  1. You can use the dnf command with the repoquery subcommand and the --queryformat option to list selected information about all installed packages. For example, to list the package names and descriptions of all installed packages, you can use the following command:
$ dnf repoquery --queryformat '%{NAME} %{SUMMARY}\n' --installed

I hope this helps! Let me know if you have any questions.

Related Solutions