In my last article I shared the steps to download an rpm along with it’s dependencies list, but in this article I will share the steps to get complete dependencies list of rpm so in case you do not have access to the repository, you can manually download and install the missing dependencies. I would although recommend to create a local offline repository by syncing an online repo.

How to get complete dependencies list of rpm

There can be multiple scenarios under which you may wish to get complete dependencies list of rpm, below are few which I can think of:

  • installed rpm
  • rpm is available on the repository (online)
  • rpm is available locally (but not installed)

 

Get complete dependencies list of rpm (installed)

If the rpm is already installed then use the below command to get the list of dependencies for that rpm

# rpm -qR glibc
/sbin/ldconfig
/usr/sbin/glibc_post_upgrade.x86_64
basesystem
config(glibc) = 2.17-222.el7
glibc-common = 2.17-222.el7
ld-linux-x86-64.so.2()(64bit)
ld-linux-x86-64.so.2(GLIBC_2.2.5)(64bit)
ld-linux-x86-64.so.2(GLIBC_2.3)(64bit)
libCNS.so()(64bit)
libGB.so()(64bit)
libISOIR165.so()(64bit)
libJIS.so()(64bit)
libJISX0213.so()(64bit)
libKSC.so()(64bit)
libc.so.6()(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
libc.so.6(GLIBC_2.3.2)(64bit)
libc.so.6(GLIBC_2.3.3)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libdl.so.2()(64bit)
libdl.so.2(GLIBC_2.2.5)(64bit)
libfreebl3.so()(64bit)
libfreebl3.so(NSSRAWHASH_3.12.3)(64bit)
libgcc
libnsl.so.1()(64bit)
libnsl.so.1(GLIBC_2.2.5)(64bit)
libnss_files.so.2()(64bit)
libpthread.so.0()(64bit)
libpthread.so.0(GLIBC_2.2.5)(64bit)
libpthread.so.0(GLIBC_2.3.2)(64bit)
libresolv.so.2()(64bit)
libresolv.so.2(GLIBC_2.2.5)(64bit)
libresolv.so.2(GLIBC_2.9)(64bit)
rpmlib(BuiltinLuaScripts) <= 4.2.2-1
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1

Here -q means query and -R means Require, which will list capabilities on which this package depends.

 

Get complete dependencies list of rpm (available on repo)

If the rpm is part of some online or offline repo then you can use yum deplist.

# yum deplist glibc
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
package: glibc.i686 2.17-196.el7_4.2
  dependency: basesystem
   provider: basesystem.noarch 10.0-7.el7
  dependency: glibc-common = 2.17-196.el7_4.2
   provider: glibc-common.x86_64 2.17-196.el7_4.2
  dependency: libfreebl3.so
   provider: nss-softokn-freebl.i686 3.28.3-8.el7_4
  dependency: libfreebl3.so(NSSRAWHASH_3.12.3)
   provider: nss-softokn-freebl.i686 3.28.3-8.el7_4
  dependency: libgcc
   provider: libgcc.x86_64 4.8.5-16.el7_4.2
   provider: libgcc.i686 4.8.5-16.el7_4.2
package: glibc.x86_64 2.17-196.el7_4.2
  dependency: basesystem
   provider: basesystem.noarch 10.0-7.el7
  dependency: glibc-common = 2.17-196.el7_4.2
   provider: glibc-common.x86_64 2.17-196.el7_4.2
  dependency: libfreebl3.so()(64bit)
   provider: nss-softokn-freebl.x86_64 3.28.3-8.el7_4
  dependency: libfreebl3.so(NSSRAWHASH_3.12.3)(64bit)
   provider: nss-softokn-freebl.x86_64 3.28.3-8.el7_4
  dependency: libgcc
   provider: libgcc.x86_64 4.8.5-16.el7_4.2
   provider: libgcc.i686 4.8.5-16.el7_4.2

 

But this gives the list of modules which are the dependency of glibc rpm, and this is not very helpful if you plan to install the dependencies manually.

As much better tool for such cases is repoquery

# repoquery -R --resolve --recursive glibc
pcre-0:8.32-15.el7.x86_64
glibc-0:2.17-157.el7_3.4.i686
bash-0:4.2.46-28.el7.x86_64
libselinux-0:2.2.2-6.el7.x86_64
basesystem-0:10.0-7.el7.noarch
tzdata-0:2015f-1.el7.noarch
pcre-0:8.32-12.el7.i686
libstdc++-0:4.8.3-9.el7.x86_64
libgcc-0:4.8.5-4.el7.x86_64
ncurses-libs-0:5.9-13.20130511.el7.x86_64
ncurses-base-0:5.9-14.20130511.el7_4.noarch
nss-softokn-freebl-0:3.16.2.3-14.4.el7.i686
glibc-0:2.17-106.el7_2.4.x86_64
filesystem-0:3.2-20.el7.x86_64
redhat-release-server-0:7.0-1.el7.x86_64
libsepol-0:2.5-6.el7.x86_64
setup-0:2.8.71-5.el7.noarch
libgcc-0:4.8.2-16.2.el7_0.i686
glibc-common-0:2.17-196.el7_4.2.x86_64

As you see this gave us a list of all the dependencies of glibc rpm in the format of rpm and not libraries or modules. So you can download and install these list of rpms manually if you do not have access to yum repo.

 

Get complete dependencies list of rpm (available locally but not installed)

If the rpm is available locally on your server then you can get the list of dependencies using rpm -qpR

# rpm -qpR glibc-2.17-222.el7.x86_64.rpm
/sbin/ldconfig
/usr/sbin/glibc_post_upgrade.x86_64
basesystem
config(glibc) = 2.17-222.el7
glibc-common = 2.17-222.el7
ld-linux-x86-64.so.2()(64bit)
ld-linux-x86-64.so.2(GLIBC_2.2.5)(64bit)
ld-linux-x86-64.so.2(GLIBC_2.3)(64bit)
libCNS.so()(64bit)
libGB.so()(64bit)
libISOIR165.so()(64bit)
libJIS.so()(64bit)
libJISX0213.so()(64bit)
libKSC.so()(64bit)
libc.so.6()(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
libc.so.6(GLIBC_2.3.2)(64bit)
libc.so.6(GLIBC_2.3.3)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libdl.so.2()(64bit)
libdl.so.2(GLIBC_2.2.5)(64bit)
libfreebl3.so()(64bit)
libfreebl3.so(NSSRAWHASH_3.12.3)(64bit)
libgcc
libnsl.so.1()(64bit)
libnsl.so.1(GLIBC_2.2.5)(64bit)
libnss_files.so.2()(64bit)
libpthread.so.0()(64bit)
libpthread.so.0(GLIBC_2.2.5)(64bit)
libpthread.so.0(GLIBC_2.3.2)(64bit)
libresolv.so.2()(64bit)
libresolv.so.2(GLIBC_2.2.5)(64bit)
libresolv.so.2(GLIBC_2.9)(64bit)
rpmlib(BuiltinLuaScripts) <= 4.2.2-1
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1

 

Lastly I hope the steps from the article to get complete dependencies list of rpm was helpful. So, let me know your suggestions and feedback using the comment section.

 

Leave a Reply

Your email address will not be published. Required fields are marked *