1

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) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rtld(GNU_HASH)
rpmlib(PayloadIsXz) <= 5.2-1
[root@localhost boot]# rpm -q --provides libsysfs-2.1.0-16.el7.x86_64
libsysfs = 2.1.0-16.el7
libsysfs(x86-64) = 2.1.0-16.el7
libsysfs.so.2()(64bit)

I've checked with rpm -q --provides what capabilities are provided with the libsysfs-2.1.0-16.el7.x86_64 package and it listed 3 items.

When I run now yum remove libsysfs-2.1.0-16.el7.x86_64 I get the following:

[root@localhost boot]# yum remove libsysfs-2.1.0-16.el7.x86_64
Loaded plugins: changelog, fastestmirror
Resolving Dependencies
--> 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 !

2
  • 1
    Your last command should be rpm -ql libsysfs. -p means query an uninstalled package - which means specifying the full filename including the extension, e.g. libsysfs-2.1.0-16.el7.x86_64.rpm – fpmurphy Jan 11 at 13:32
  • @fpmurphy True. Any thoughts about the rest ? – cyzczy Jan 11 at 14:40
0

"Do I need really to care if the package is marked as orphaned?" No, just means that the package is not available from any of your currently configured repositories.

Quoting from the RPM Guide:

In RPM terminology, each package provides capabilities. A capability is simply a text string that the package claims it provides. In most cases, a capability names a file or a package. But the capability can be any arbitrary text string.

Looking at the output of rpm -q --provides libsysfs on my system (Fedora 33), three capabilities are provided:

# rpm -q --provides libsysfs
libsysfs = 2.1.0-30.fc33
libsysfs(x86-64) = 2.1.0-30.fc33
libsysfs.so.2()(64bit)

One or more of these 3 capabilities might be checked by rpm (or yum or dnf) when you install a package. If no currently installed package requires any of these 3 capabilities, you can delete the package without encountering a dependency error.

Moving on, your last command should be rpm -ql libsysfs. -p means query an uninstalled package - which requires providing the full filename including the extension, e.g. libsysfs-2.1.0-16.el7.x86_64.rpm

BTW, you do not need to type yum remove libsysfs-2.1.0-16.el7.x86_64 to remove this package. yum remove libsysfs is sufficient.

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.