How to get list of dependencies of non-installed RPM package?

apt-cache show <package> shows also it's dependencies.

yum info <package> does not show dependencies, but it obviously know them.

How to ask yum for dependencies of specified package?


Solution 1:

yum doesn't have that capability. Use the repoquery tool from the yum-utils package instead.

repoquery --requires <package>

OR to also see which additional RPM packages are needed to satisfy the dependencies, use --resolve

repoquery --requires --resolve <package>

Solution 2:

Use deplist command,

yum deplist <package>

From yum's manual:

Produces a list of all dependencies and what packages provide those dependencies for the given packages.

Update for dnf

To do the same thing with dnf, we can do

dnf repoquery --requires <package>

As man yum2dnf said:

Alternative to Yum deplist command to find out dependencies of the package is dnf repoquery --requires using repoquery plugin.