While working on a temporary fix for my servers, for Dirty-COW , I discovered what seems to be a bug in CentOS 7. The bug seems to be wrong kernel version of a kernel-debuginfo package. Here is the kernel version:
# uname -r
3.10.0-327.36.2.el7.x86_64
The above seems to match with kernel devel version:
# yum install kernel-devel
Package kernel-devel-3.10.0-327.36.2.el7.x86_64 already installed and latest version
Nothing to do
However, this does not match with the following kernel version:
# rpm -qa |grep kernel-debuginfo
kernel-debuginfo-4.4.22-201.el7.centos.x86_64
kernel-debuginfo-common-x86_64-4.4.22-201.el7.centos.x86_64
Trying to install the correct packagages results in an erroneous message that the correct packages are already installed:
# yum install kernel-debuginfo-common-x86_64-3.10.0-327.36.2.el7.x86_64 kernel-debuginfo-3.10.0-327.36.2.el7.x86_64
Loaded plugins: auto-update-debuginfo, fastestmirror
Loading mirror speeds from cached hostfile
Package matching kernel-debuginfo-common-x86_64-3.10.0-327.36.2.el7.x86_64 already installed. Checking for update.
Package matching kernel-debuginfo-3.10.0-327.36.2.el7.x86_64 already installed. Checking for update.
Nothing to do
To resolve this I first tried:
yum erase kernel-debuginfo kernel-debuginfo-common
That did not remove the common package.
# rpm -qa |grep kernel-debuginfo
kernel-debuginfo-common-x86_64-4.4.22-201.el7.centos.x86_64
To remove that package I used:
# rpm -e kernel-debuginfo-common-x86_64-4.4.22-201.el7.centos.x86_64
After this, the install works normally:
# debuginfo-install kernel-$(uname -r)
Package yum-plugin-auto-update-debug-info-1.1.31-34.el7.noarch already installed and latest version
--> Running transaction check
---> Package kernel-debuginfo.x86_64 0:3.10.0-327.36.2.el7 will be installed
--> Processing Dependency: kernel-debuginfo-common-x86_64 = 3.10.0-327.36.2.el7 for package: kernel-debuginfo-3.10.0-327.36.2.el7.x86_64
--> Running transaction check
---> Package kernel-debuginfo-common-x86_64.x86_64 0:3.10.0-327.36.2.el7 will be installed
--> Finished Dependency Resolution
Now my question is: can anybody explain this behaviour other than this is a bug in CentOS 7?
Behaviour of what? This is rather strange yum output: when you try to install package with lower version that you have already installed, it says "Package matching XXX already installed". When you removed newer packages you successfully installed older version with yum.
Simple example: