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

173,504

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.

Solution 3

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

rpm -qpR mediawiki-1.4rc1-4.i586.rpm

Solution 4

If you need the list of packages needed, use:

dnf repoquery --requires --resolve`

In the case of firefox, by running:

sudo dnf repoquery --requires --resolve firefox

I've got the ouput: Last metadata expiration check: 0:00:00 ago on Wed 13 Dec 2017 21:41:47 GMT. atk-0:2.26.1-1.fc27.x86_64 bash-0:4.4.12-12.fc27.x86_64 cairo-0:1.15.8-1.fc27.x86_64 cairo-gobject-0:1.15.8-1.fc27.x86_64 dbus-glib-0:0.108-4.fc27.x86_64 dbus-libs-1:1.12.0-1.fc27.x86_64 fontconfig-0:2.12.6-4.fc27.x86_64 freetype-0:2.8-6.fc27.x86_64 freetype-freeworld-0:2.8-4.fc27.x86_64 gdk-pixbuf2-0:2.36.11-1.fc27.x86_64 glib2-0:2.54.2-1.fc27.x86_64 glibc-0:2.26-16.fc27.i686 glibc-0:2.26-16.fc27.x86_64 gtk2-0:2.24.31-6.fc27.x86_64 gtk3-0:3.22.26-1.fc27.x86_64 hunspell-0:1.5.4-4.fc27.x86_64 libX11-0:1.6.5-4.fc27.x86_64 libX11-xcb-0:1.6.5-4.fc27.x86_64 libXcomposite-0:0.4.4-11.fc27.x86_64 libXdamage-0:1.1.4-11.fc27.x86_64 libXext-0:1.3.3-7.fc27.x86_64 libXfixes-0:5.0.3-4.fc27.x86_64 libXrender-0:0.9.10-4.fc27.x86_64 libXt-0:1.1.5-6.fc27.x86_64 libffi-0:3.1-14.fc27.x86_64 libgcc-0:7.2.1-2.fc27.x86_64 libjpeg-turbo-0:1.5.1-4.fc27.x86_64 libstdc++-0:7.2.1-2.fc27.x86_64 libvpx-0:1.6.1-4.fc27.x86_64 libxcb-0:1.12-5.fc27.x86_64 mozilla-filesystem-0:1.9-17.fc27.x86_64 nspr-0:4.17.0-1.fc27.i686 nspr-0:4.17.0-1.fc27.x86_64 nss-0:3.34.0-1.0.fc27.i686 nss-0:3.34.0-1.0.fc27.x86_64 nss-util-0:3.34.0-1.0.fc27.x86_64 p11-kit-trust-0:0.23.8-1.fc27.i686 p11-kit-trust-0:0.23.9-2.fc27.x86_64 pango-0:1.40.14-1.fc27.x86_64 startup-notification-0:0.12-14.fc27.x86_64 u2f-hidraw-policy-0:1.0.2-5.fc27.x86_64 zlib-0:1.2.11-4.fc27.x86_64

Solution 5

If you want to install a package and it's dependencies via yum, try the localinstall option instead if install. The localinstall install a package and finds any dependencies and downloads them:

$ yum -y localinstall <package>

I am no yum guru but this works fine for me, makes it easy to install including dependencies :-)

Share:
173,504

Related videos on Youtube

Vi.
Author by

Vi.

Updated on September 18, 2022

Comments

  • Vi.
    Vi. over 1 year

    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?

  • Usman Ismail
    Usman Ismail about 12 years
    How would I do the same if I have a local rpm file?
  • Vi.
    Vi. over 11 years
    Maybe extract the control file from rpm package and look into it?
  • Ignacio Vazquez-Abrams
    Ignacio Vazquez-Abrams over 11 years
    If you have it downloaded then you use rpm -qp --requires <package file>.
  • deesto
    deesto over 10 years
    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.
  • Asclepius
    Asclepius over 9 years
    Works for URLs too.
  • natxo asenjo
    natxo asenjo almost 9 years
    if you ommit -q then you can query your configured repos: rpm -qR graphviz lists all the dependencies for me
  • nlu
    nlu over 7 years
    If you use RHN, you need to add --plugins to the call to repoquery. See stackoverflow.com/questions/15433843/…
  • haridsv
    haridsv over 5 years
    What does --resolve actually do? Running repoquery --requires --resolve on a package that is already installed should return an empty list right, since all dependencies are already satisfied? When I tried it on a package that is already installed, I got a few listed, including itself (all of these are already installed).
  • Elliott B
    Elliott B about 3 years
    I don't think it's true that yum can't do this. See the answer below