Linux distribution: Red Hat Enterprise Linux Server release 6.10 (Santiago)
Context:
I need to uninstall all old versions of Java in my server.
I have the list of java paths, example:
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el6_10.x86_64/jre/bin/java
I can find the pacakage owning this file by:
rpm -qf /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el6_10.x86_64/jre/bin/java
java-1.8.0-openjdk-headless-1.8.0.201.b09-2.el6_10.x86_64
Now, how to find all packages depending on java-1.8.0-openjdk-headless-1.8.0.201.b09-2.el6_10.x86_64
, so that I can see whether it is safe to remove the package ?
Below command says no other packages depends on this openjdk package (Ref: Question-166343):
rpm -q --whatrequires java-1.8.0-openjdk-headless-1.8.0.201.b09-2.el6_10.x86_64
no package requires java-1.8.0-openjdk-headless-1.8.0.201.b09-2.el6_10.x86_64
But, mysql-connector-java
depends on this package.
Reason: rpm --whatrequires
option's argument is CAPABILITY provided by a package , not package name and searching using CAPABILITY is not straightforward.
Below command was also not returning any results:
repoquery --requires --resolve --recursive java-1.8.0-openjdk-headless-1.8.0.201.b09-2.el6_10.x86_64
So, is there any simple way to identify all rpm packages which depends on a particular package?
By package , I mean java-1.8.0-openjdk-headless-1.8.0.201.b09-2.el6_10.x86_64
(not java-1.8.0-openjdk-headless
)
yum
?yum --assumeno ...
orrpm --test ...
yum deplist
would show the packages on which it depends but not what depends on the package itself.