Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 57 down vote accepted

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>
share|improve this answer
    
How would I do the same if I have a local rpm file? – Usman Ismail Apr 23 '12 at 15:38
    
Maybe extract the control file from rpm package and look into it? – Vi. Nov 26 '12 at 10:56
11  
If you have it downloaded then you use rpm -qp --requires <package file>. – Ignacio Vazquez-Abrams Nov 26 '12 at 12:27

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.

share|improve this answer
5  
Unfortunately, this will return a list of all possible providers of each dependency, which can end up returning many hundreds or thousands of lines, instead of a simple list of the names of dependent packages. – deesto Aug 8 '13 at 20:00

If you have a local RPM, you can get a list of dependencies via:

rpm -qpR mediawiki-1.4rc1-4.i586.rpm
share|improve this answer
2  
Works for URLs too. – A-B-B Aug 27 '14 at 22:19
    
if you ommit -q then you can query your configured repos: rpm -qR graphviz lists all the dependencies for me – natxo asenjo May 4 '15 at 13:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .