Fedora – How to list RPM packages that depend on a specific library

fedoralibrariesrpm

I would like to determine which RPM packages on my Fedora 25 system depend on the libraries libLLVM-3.8.so and libclang-3.8.so. How do I?

Best Answer

You can use dnf repoquery to find this. For example:

dnf repoquery --whatrequires libLLVM-3.8.so

however, on an x86_64 system, this might not do quite what you want; to specify the x86_64 version of a library (which probably is what you want), tack on ()(64bit), like this:

dnf repoquery --whatrequires 'libLLVM-3.8.so()(64bit)' 

(With ' now necessary to keep the parentheses from confusing bash.)

By default, this lists both available and installed packages; to restrict to the ones that are currently installed, add the --installed flag, like so:

dnf repoquery --whatrequires 'libLLVM-3.8.so()(64bit)'  --installed

which on my system, returns:

llvm-libs-0:3.8.0-1.fc25.x86_64
mesa-dri-drivers-0:13.0.2-2.fc25.x86_64
mesa-libxatracker-0:13.0.2-2.fc25.x86_64

If you want just package names, add --queryformat '%{name}\n'. (Use dnf repoquery --querytags to get other formatting options.)

Related Question