Who Can Help You Check RPM Package Dependencies on a Linux System?

Prabahar
3 min readSep 13, 2023

--

Who Can Help You Check RPM Package Dependencies on a Linux System?
Everything You Need to Know About RPM Package Dependencies on Linux Systems

To check the RPM package dependencies on a Linux system, you can use various commands and tools depending on your specific distribution. Here are some common methods for checking RPM dependencies:

  1. Usingrpm Command (For RPM-based systems like Red Hat, CentOS, and Fedora):

To check the dependencies of a specific RPM package, you can use the rpm command with the -q and --requires options. For example:

rpm -q --requires <package_name>

Example:
package_name="389-ds-base-devel-1.3.10.2-6.el7.x86_64.rpm"
rpm -q --requires $package_name

Output:
/usr/bin/pkg-config
389-ds-base-libs = 1.3.10.2-6.el7
libevent
libldaputil.so.0()(64bit)
libnunc-stans.so.0()(64bit)
libsds.so.0()(64bit)
libslapd.so.0()(64bit)
libtalloc
libtevent
nspr-devel
nss-devel >= 3.34
openldap-devel
pkgconfig
pkgconfig(nspr)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
svrcore-devel >= 4.1.3
systemd-libs
rpmlib(PayloadIsXz) <= 5.2-1

Replace <package_name> with the name of the RPM package you want to check. This will list the dependencies required by the specified package.

To check the dependencies of an installed package, use:

rpm -q --requires -p <package.rpm>

or

rpm -qpR <package.rpm>
-qpR above is equivalent to --query --package --requires

Replace <package.rpm> with the path to the RPM package file.

2. Using dnf or yum (For modern Fedora, CentOS, and RHEL systems):

You can use the dnf or yum package manager to check RPM package dependencies. For example, to check the dependencies for an RPM package:

dnf repoquery --requires <package_name>

or

yum -q deplist <package_name>

or

yum repoquery --requires <package_name>

Replace <package_name> with the name of the package.

3. Using repoquery (For YUM-based systems):

On systems that use yum, you can use the repoquery command to check RPM package dependencies:

repoquery --requires <package_name>

Again, replace <package_name> with the name of the package.

4. Using rpmdeps (General method for RPM dependency checking):

The rpmdeps command can help you visualize the dependency tree of an RPM package. It's a bit more advanced and can show both runtime and build-time dependencies:

rpmdeps -d <package.rpm>

Replace <package.rpm> with the path to the RPM package file.

Remember to replace <package_name> or <package.rpm> with the actual package name or file path you want to inspect. These commands will display a list of dependencies, and you can analyze them to ensure that all required packages are installed on your system.

To check Debian package dependencies on a Debian-based system (e.g., Debian, Ubuntu), you can use various commands and tools. Here are some common methods for checking package dependencies:

  1. Using dpkg Command:

To check the dependencies of a specific Debian package, you can use the dpkg command with the -I option followed by the package name. For example:

dpkg -I <package_name>

Replace <package_name> with the name of the Debian package you want to check. This command will display information about the package, including its dependencies.

2. Using apt-cache:

The apt-cache command allows you to query information about packages, including their dependencies. To check the dependencies for a package, you can use the depends option like this:

apt-cache depends <package_name>

Replace <package_name> with the name of the package. This command will display a list of dependencies and their relationships (e.g., Depends, Recommends, Suggests).

3. Using apt-rdepends:

The apt-rdepends command provides a way to recursively check package dependencies. Install it if it's not already installed:

sudo apt-get install apt-rdepends

Then, to check dependencies for a package, run:

apt-rdepends -r <package_name>

This command will list all packages that depend on <package_name> and their dependencies as well.

4. Using aptitude:

aptitude is a text-based package manager that can be used to inspect package dependencies interactively. Install it if it's not already installed:

sudo apt-get install aptitude

Then, start aptitude and use its interface to search for package information and dependencies:

aptitude

Within aptitude, you can search for a package by its name and view its details, including dependencies.

These methods should help you check and understand package dependencies on Debian-based systems. Choose the one that best suits your needs and familiarity with the tools.

--

--