1

I am considering using LibreSSL instead of OpenSSL for CentOS 7. Since this machine will be very limited in what services it runs, I wondered whether OpenSSL could be removed entirely.

#> rpm -qa | grep ssl
openssl-libs-1.0.1e-42.el7.9.x86_64
openssl-1.0.1e-42.el7.9.x86_64

Okay, so try

#> rpm -q --whatrequires openssl-libs-1.0.1e-42.el7.9.x86_64
no package requires openssl-libs-1.0.1e-42.el7.9.x86_64
#> rpm -q --whatrequires openssl-1.0.1e-42.el7.9.x86_64
no package requires openssl-1.0.1e-42.el7.9.x86_64

Really?

#> sudo yum remove openssl-libs-1.0.1e-42.el7.9.x86_64

This gives lots of lines such as this:

--> Processing Dependency: perl(IPC::Cmd) >= 0.42 for package: perl-File-Fetch-0.42-2.el7.noarch
--> Running transaction check
---> Package perl-File-Fetch.noarch 0:0.42-2.el7 will be erased

etc ad nauseum, then

Error: Trying to remove "systemd", which is protected
Error: Trying to remove "yum", which is protected

I wasn't expecting removing OpenSSL to happen without complaint, but why does rpm -q --whatrequires fail to report these depenencies?

How do I list all packages which require, directly or indirectly, a given package?

By this I mean: if package X were to be removed, and package/file Y will be removed if X is removed, and package Z depends on Y, how do I list all such Z for any given X?

2

As already mentioned other packages may require files or something else from the "provides" list of the package:

rpm -q --list openssl openssl-libs
rpm -q --provides openssl openssl-libs

To see whether there are some "whatrequires" (not all):

rpm -e --test openssl openssl-libs

To list all is IMO not directly possible with rpm but in yum case (untested):

yes "N" | yum remove openssl openssl-libs

or

yum deplist openssl openssl-libs

or

repoquery --alldeps --whatrequires openssl openssl-libs
1

that just means nobody explicitly asks for that package to be installed; but some packages can depend on files installed by those packages. For example on my machine; nobody depends on the package; but some depend on the library provided by the package:

$ rpm -q libopenssl1_0_0-32bit
libopenssl1_0_0-32bit-1.0.1i-18.1.x86_64 # whence this package is installed
$ rpm -q --whatrequires libopenssl1_0_0-32bit
no package requires libopenssl1_0_0-32bit
$ rpm -ql libopenssl1_0_0-32bit
/lib/engines
/lib/engines/libcapi.so
/lib/engines/libgmp.so
/lib/engines/libgost.so
/lib/engines/libpadlock.so
/lib/libcrypto.so.1.0.0
/lib/libssl.so.1.0.0
$ rpm -q --whatrequires libssl.so.1.0.0
libldap-2_4-2-32bit-2.4.41-14.1.x86_64
cups-libs-32bit-1.7.5-7.1.x86_64

EDIT due to edited question:

you can use rpm -e --test to find out which are those rpms. With some bash processing you can get a clean list:

$ rpm -e --test libopenssl1_0_0-32bit 2>&1 | grep needed | awk '{print $6}' | sort | uniq
cups-libs-32bit-1.7.5-7.1.x86_64
libldap-2_4-2-32bit-2.4.41-14.1.x86_64
  • Thanks. So how do I list dependencies of all files contained in a package? Question edited. – spraff Oct 12 '16 at 14:47
  • edited my answer – Chris Maes Oct 12 '16 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.