yum confusion about package-cleanup --orphans and --leaves
1
vote
1
answer
2434
views
While following https://access.redhat.com/solutions/64069
General documentation of the system state both prior to and after patching is always good practice. This should include running package-cleanup with following flags, --orphans, --problems, --dupes, --leaves.
Looking for orphans (packages which are not available from currently configured repositories) I did get
kernel-3.10.0-1127.el7.x86_64
and it would be true, because I've installed CentOS 7.8 and upgraded to 7.9 and the kernel package is in the https://vault.centos.org/7.8.2003/os/Source/SPackages/ repo not the 7.9.
[root@localhost boot]# package-cleanup --orphans
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.wielun.net
* extras: centos.wielun.net
* updates: centos.wielun.net
kernel-3.10.0-1127.el7.x86_64
[root@localhost boot]# rpm -qa kernel
kernel-3.10.0-1160.6.1.el7.x86_64
kernel-3.10.0-1127.el7.x86_64
I can imagine that it would be advisable to run the above command in case I would like to use yum history undo
to revert last made changes, and that a given rpm
package would have to be available on the system, but if it was not removed during yum update
then do I need really to care if the package is marked as orphaned
?
Next, I executed the following command, to get a list of leaves ( Leaf nodes are RPMs that are not relied upon by any other RPM):
[root@localhost boot]# package-cleanup --leaves
Loaded plugins: fastestmirror
libsysfs-2.1.0-16.el7.x86_64
[root@localhost boot]# rpm -q --requires libsysfs-2.1.0-16.el7.x86_64
/sbin/ldconfig
/sbin/ldconfig
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
rpmlib(CompressedFileNames) Running transaction check
---> Package libsysfs.x86_64 0:2.1.0-16.el7 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================
Removing:
libsysfs x86_64 2.1.0-16.el7 @anaconda 146 k
Transaction Summary
=============================================================================================================================================================================================
Remove 1 Package
Per my understanding yum resolved all the dependencies and it looks like I'm free to remove the pacakage, but I'm wondering about the output of the rpm -q --provides
command. Is it correct to say that the 3 items listed is stuff that got installed together with the libsysfs.x86_64 0:2.1.0-16.el7
package AND since yum resolved all dependencies and no other stuff on the system requires this package + the packages/shared libraries it provides it can be removed without any issues ?
If that is true, why I'm not able to list the files installed as part of that rpm ?
[root@localhost boot]# rpm -qa libsysfs
libsysfs-2.1.0-16.el7.x86_64
[root@localhost boot]#
[root@localhost boot]#
[root@localhost boot]# rpm -qlp libsysfs-2.1.0-16.el7.x86_64
error: open of libsysfs-2.1.0-16.el7.x86_64 failed: No such file or directory
Thank you for any clarification is possible !
Asked by cyzczy
(396 rep)
Jan 11, 2021, 01:08 PM
Last activity: Jul 28, 2025, 02:09 AM
Last activity: Jul 28, 2025, 02:09 AM