Why reverse dependencies does not work with rpm command?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL)

Issue

  • While checking the package dependencies for one package, it works well as below :-
This is just an example

#  rpm -qR httpd
It displays the list of dependencies as below:-

/bin/bash 
/bin/sh 
/bin/sh 
/bin/sh 
/bin/sh 
/bin/sh 
/etc/mime.types 
/usr/sbin/useradd 
apr-util-ldap 
chkconfig 
config(httpd) = 2.2.15-29.el6_4
httpd-tools = 2.2.15-29.el6_4
initscripts >= 8.36
libapr-1.so.0()(64bit) 
libaprutil-1.so.0()(64bit) 
libc.so.6()(64bit) 
libc.so.6(GLIBC_2.2.5)(64bit) 
libc.so.6(GLIBC_2.3)(64bit) 
libc.so.6(GLIBC_2.3.4)(64bit) 
libc.so.6(GLIBC_2.4)(64bit) 
libcrypt.so.1()(64bit) 
libdb-4.7.so()(64bit) 
libexpat.so.1()(64bit) 
liblber-2.4.so.2()(64bit) 
libldap-2.4.so.2()(64bit) 
libm.so.6()(64bit) 
libpcre.so.0()(64bit) 
libpthread.so.0()(64bit) 
libpthread.so.0(GLIBC_2.2.5)(64bit) 
libselinux.so.1()(64bit) 
libz.so.1()(64bit) 
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(VersionedDependencies) <= 3.0.3-1
rtld(GNU_HASH) 
system-logos >= 7.92.1-1
rpmlib(PayloadIsXz) <= 5.2-1
  • However, checking it in a reverse manner, by picking up any package listed above in the 'dependency list' with 'whatrequires', it gives the following output :-
# rpm -q --whatrequires libldap
no package requires libldap
# rpm -q --whatrequires rpmlib
no package requires rpmlib
# rpm -q --whatrequires libz

Resolution

  • Check what should be the correct name to be passed in provides syntax for a .so file as mentioned in the following example :-
# rpm -q --provides libXfont
libXfont.so.1()(64bit)  
libXfont = 1.2.2-1.0.4.el5_7
  • Specify the exact provides syntax for .so file as mentioned in the following example :-
# rpm -q --whatrequires 'libXfont.so.1()(64bit)
libXfont-1.2.2-1.0.4.el5_7
xorg-x11-font-utils-7.1-3
xorg-x11-xfs-1.0.2-5.el5_6.1
xorg-x11-server-Xvfb-1.1.1-48.101.el5_10.1

Root Cause

  • .so files are not rpms. Providing just a rpm name dose not work here, provide the arch detials as well, as mentioned in resolution.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments