There might come a time when you want to know if you have already installed a certain package on your RHEL 8. An application to be manually installed might require certain dependencies to work so you'll have to check beforehand if these are satisfied. Or you might want to compile something and want to make sure you have all the right header libraries on your system.

In this tutorial you will learn:
  • How to use yum and dnf in Red Hat Enterprise Linux 8 to list all packages
  • How to use the repoquery command to accomplish the same task
  • How to use the rpm command to list all packages installed on RHEL 8
  • How to filter the output of each command to seek certain packages
Use the repoquery command to list all available packages in RHEL 8
Use the repoquery command to list all available packages in RHEL 8

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Red Hat Enterprise Linux 8
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # - requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ - requires given linux commands to be executed as a regular non-privileged user

Using yum and dnf

One way to check what you have installed using yum and the RHEL 8 repositories is to use
$ yum list installed
This will list all installed packages in alphabetical order. You can pipe the output to grep if you are looking for something in particular, say anything related to the bzip2 package:
$ yum list installed | grep bzip2
As you can see in the image below, the command lists both the bzip2 binary package and the bzip2 library package. You even get the version number of the software so, if you might need an earlier version installed, you'll know when to downgrade. The dnf command works exactly the same way as yum, with the same attributes, so you can use that if you fancy it.
You can use yum to search for a package and grep for a certain package using a pipe
You can use yum to search for a package and grep for a certain package using a pipe

SUBSCRIBE TO NEWSLETTER
Subscribe to Linux Career NEWSLETTER and receive latest Linux news, jobs, career advice and tutorials.


Use the repoquery command

Another way to list available packages is to use dnf-utils. The package set is used to manage repositories and one of its functions is the ability to list installed packages. Make sure you installed dnf-utils with
# dnf install dnf-utils
then use the repoquery command that comes with dnf-utils to list all installed packages:
$ repoquery -a --installed
Same as with the piped grep above, we can also use grep here to filter what we are interested in:
$ repoquery -a --installed | grep bzip2

List installed packages using the rpm command

A third way to list installed packages is to use the rpm command and make it do a query for all installed packages:
$ rpm -qa
If you want to look for all packages pertaining to bzip2 use
$ rpm -qa bzip2*
Look for all packages related to bzip2 by querying them with the rpm command
Look for all packages related to bzip2 by querying them with the rpm command


And finally - the GUI

If you want to use a graphical user interface, the Software package management application offers a tab listing all installed applications. The downside being that it only lists the names of the applications and not their package names; dependencies are also not shown and the overall information provided is limited.
Software lists installed applications but not their dependencies and package names
Software lists installed applications but not their dependencies and package names
ARE YOU LOOKING FOR A LINUX JOB?
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed on LinuxCareers.com.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in:



Comments and Discussions