How to Check RPM Package Dependencies on RHEL/CentOS/Fedora
This tutorial explains multiple methods to examine RPM package dependencies on Red Hat‑based systems, covering commands for installed and uninstalled packages, using tools such as rpm, yumdownloader, repoquery, rpmreaper, and rpmdep, with step‑by‑step examples and required installations.
On Red Hat‑based Linux systems, an RPM package must have its required dependencies installed before it can function correctly. While tools like yum or dnf hide these relationships from end users, system administrators need to understand and manage them.
This guide shows how to inspect RPM package dependencies, whether the package is already installed or not.
Method 1: Using the rpm command
The rpm -qR command lists all dependencies of an installed package.
Note: This works only for packages that are already installed. To check an uninstalled package, download the RPM file first (without installing it).
Install yumdownloader to fetch RPM files without installing: $ sudo yum install yum-utils Download the RPM for tcpdump: $ yumdownloader --destdir=. tcpdump Show its dependencies:
# rpm -qpR tcpdump-4.4.0-2.fc19.i686.rpmMethod 2: Using repoquery
The repoquery tool (part of yum-utils) lists dependencies regardless of whether the package is installed. $ sudo yum install yum-utils Display dependencies for a package:
$ repoquery --requires --resolve <package-name>Ensure network connectivity so repoquery can query the enabled Yum repositories.
Method 3: Using rpmreaper
rpmreaperprovides an ncurses interface that visualizes installed packages and their dependency trees. $ sudo yum install rpmreaper Run the tool: $ rpmreaper Within the interface, use the arrow keys to navigate, press r to view a package's dependencies, L to identify leaf packages, o for intermediate nodes, and b to see reverse dependencies.
Method 4: Using rpmdep and Graphviz
The rpmdep command generates a complete dependency graph for installed packages, which can be visualized with dot (Graphviz). $ sudo yum install rpmorphan graphviz On CentOS, install the tools manually:
$ wget http://downloads.sourceforge.net/project/rpmorphan/rpmorphan/1.14/rpmorphan-1.14-1.noarch.rpm
$ sudo rpm -ivh rpmorphan-1.14-1.noarch.rpm
$ sudo yum install graphvizGenerate a DOT file for a package (e.g., gzip) and convert it to PNG:
$ rpmdep.pl -dot gzip
$ dot -Tpng -o output.png gzip.dotSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
