Check RPM package dependencies on Rhel/Centos/Rocky

Files with the .RPM extension are software packages intended for installation on Red Hat Enterprise Linux or one of its derivative Linux distributions, such as CentOS, AlmaLinux, Rocky Linux, or Fedora. When you install software by using an RPM file, your system may need to install dependencies for it to run correctly. This is common behavior for the dnf package manager as well, so you may already be familiar with package dependencies. In this tutorial, we will show you how to check the package dependencies for an RPM file on RHEL and similar distros.

In this tutorial you will learn:

  • How to check RPM package dependencies
Check RPM package dependencies on Rhel/Centos/Rocky
Check RPM package dependencies on Rhel/Centos/Rocky
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Red Hat, Fedora, CentOS, AlmaLinux, Rocky Linux
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

Check RPM package dependencies on Rhel/Centos/Rocky




To check the package dependencies, we will use the rpm command with the -qpR options.

$ rpm -qpR package.rpm

You will see various information in your terminal about the package, and the package dependencies are listed one per line as seen in the screenshot below.

Viewing the dependencies for a package on Fedora
Viewing the dependencies for a package on Fedora

Now that you have seen the package dependencies, you can continue with installing the package if you would like. We recommend using the dnf command for that:

$ sudo dnf install ./package.rpm