Incorrect Kernel Version Displayed

Issues related to applications and software problems
Post Reply
jxfish2
Posts: 24
Joined: 2013/03/08 15:07:48

Incorrect Kernel Version Displayed

Post by jxfish2 » 2020/09/18 17:26:14

I updated the kernel on a number of my CentOS and RedHat servers.

Some of these servers are displaying the correct kernel.

Some of these servers are displaying the old kernel version, even though the newer version is installed.

Examples:

1) This first server is a RedHat server, and it is displaying correctly: I need kernel 7.8 on all of my servers, whether they be RedHat or CentOS.

--> uname -r
3.10.0-1127.8.2.el7.x86_64

--> awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
Red Hat Enterprise Linux Server (3.10.0-1127.19.1.el7.x86_64) 7.8 (Maipo)
Red Hat Enterprise Linux Server (3.10.0-1127.8.2.el7.x86_64) 7.8 (Maipo)
Red Hat Enterprise Linux Server (3.10.0-1062.12.1.el7.x86_64) 7.7 (Maipo)

--> cat /etc/redhat-release /etc/system-release
Red Hat Enterprise Linux Server release 7.8 (Maipo)
Red Hat Enterprise Linux Server release 7.8 (Maipo)

2) The next server is a CentOS server, and it is displaying correctly:

--> uname -r
3.10.0-1127.19.1.el7.x86_64

--> awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
CentOS Linux (3.10.0-1127.19.1.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-1062.18.1.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-1062.9.1.el7.x86_64) 7 (Core)

--> cat /etc/redhat-release /etc/system-release
CentOS Linux release 7.8.2003 (Core)
CentOS Linux release 7.8.2003 (Core)

3) The next server is a CentOS server, and it is displaying incorrectly:

--> uname -r
3.10.0-1127.19.1.el7.x86_64

--> awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
CentOS Linux (3.10.0-1127.19.1.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-1062.9.1.el7.x86_64) 7 (Core)

--> cat /etc/redhat-release /etc/system-release
CentOS Linux release 7.7.1908 (Core)
CentOS Linux release 7.7.1908 (Core)

How can I get the version number up to 7.8 on this/these servers?

User avatar
TrevorH
Forum Moderator
Posts: 29681
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Incorrect Kernel Version Displayed

Post by TrevorH » 2020/09/18 17:47:56

I'd suspect you've broken the symlink between /etc/grub2.cfg and /boot/grub2/grub.cfg which ought to look like this (on legacy BIOS sytems, on UEFI it should point somewhere under /boot/efi):

lrwxrwxrwx. 1 root root 22 Jul 29 00:46 /etc/grub2.cfg -> ../boot/grub2/grub.cfg

If it is a file and not a symlink then be aware that it contains the most up to date grub config and the copy that it should symlink to in /boot is out of date so before you remove it to make the symlink, make sure you copy its content to the correct place.

Both of your CentOS servers appear to say 3.10.0-1127.19.1.el7.x86_64 is the running version and that is the latest and most up to date (as of now).

Your other problem is different. The files in /etc/*-release are owned by the centos-release package so perhaps you need to yum update to get the latest installed. It's just a text file and can be edited to say whatever you like though the next update of centos-release will replace them again.

And BTW, your RHEL server is NOT correct. It has the out of date 3.10.0-1127.8.2.el7.x86_64 kernel running when it should be 3.10.0-1127.19.1.el7.x86_64.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

jxfish2
Posts: 24
Joined: 2013/03/08 15:07:48

Re: Incorrect Kernel Version Displayed

Post by jxfish2 » 2020/09/18 18:03:26

Thanks Trevor.

Have a great weekend.

jxfish2
Posts: 24
Joined: 2013/03/08 15:07:48

Re: Incorrect Kernel Version Displayed

Post by jxfish2 » 2020/09/18 18:20:55

The link between /etc/grub2.cfg and /boot/grub2/grub.cfg appears to be good.

And, even though this server is running 3.10.0-1127.19.1.el7.x86_64, it's still showing as: "CentOS Linux release 7.7.1908 (Core)"

/boot/grub2/grub.cfg contains the following entries:

### BEGIN /etc/grub.d/10_linux ###
menuentry 'CentOS Linux (3.10.0-1127.19.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1062.9.1.el7.x86_64-advanced-2adf25aa-fb65-494b-93f3-17346e7e8f1b' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 8cd782c8-c5ae-40af-ae2d-3b33a21444db
else
search --no-floppy --fs-uuid --set=root 8cd782c8-c5ae-40af-ae2d-3b33a21444db
fi
linux16 /vmlinuz-3.10.0-1127.19.1.el7.x86_64 root=/dev/mapper/rootvg-rootlv ro console=tty1 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 net.ifnames=0 scsi_mod.use_blk_mq=y LANG=en_US.UTF-8
initrd16 /initramfs-3.10.0-1127.19.1.el7.x86_64.img
}
menuentry 'CentOS Linux (3.10.0-1062.9.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1062.9.1.el7.x86_64-advanced-2adf25aa-fb65-494b-93f3-17346e7e8f1b' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 8cd782c8-c5ae-40af-ae2d-3b33a21444db
else
search --no-floppy --fs-uuid --set=root 8cd782c8-c5ae-40af-ae2d-3b33a21444db
fi
linux16 /vmlinuz-3.10.0-1062.9.1.el7.x86_64 root=/dev/mapper/rootvg-rootlv ro console=tty1 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 net.ifnames=0 scsi_mod.use_blk_mq=y
initrd16 /initramfs-3.10.0-1062.9.1.el7.x86_64.img
}
if [ "x$default" = 'CentOS Linux (3.10.0-1062.9.1.el7.x86_64) 7 (Core)' ]; then default='Advanced options for CentOS Linux>CentOS Linux (3.10.0-1062.9.1.el7.x86_64) 7 (Core)'; fi;
### END /etc/grub.d/10_linux ###

NOTE: I am not authorized at this time to do a full "yum update". At this time, I am only authorized to update the kernel, and any critical / security related patches. I already updated the kernel, and the critical / security related patches, but the incorrect kernel version number is still being displayed.

Would you have any other suggestions that I might try, other than to do a full update on the servers?

Thanks in advance, and have a great weekend.

User avatar
TrevorH
Forum Moderator
Posts: 29681
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Incorrect Kernel Version Displayed

Post by TrevorH » 2020/09/18 19:04:36

And, even though this server is running 3.10.0-1127.19.1.el7.x86_64, it's still showing as: "CentOS Linux release 7.7.1908 (Core)"
What's the output from rpm -q centos-release ? The content of /etc/centos-release (and its friends) have no relationship to what kernel you are running. They are two separate things. One is defined by what kernel packages you have installed, the other by the version of the centos-release package. And since centos-release only supplies those /etc/*-release files and the CentOS copies of files under /etc/yum.repos.d, updating that does nothing at all to patch anything. You can update centos-release without patching anything and it will *tell* you that you have 7.8 but in reality you just have a text file saying you have 7.8 and nothing more.
I already updated the kernel, and the critical / security related patches
How did you do that? CentOS does not provide the necessary yum metadata for yum --security to function so it does precisely nothing. If you are relying on that to patch only security vulnerabilities then you are not patching anything since there is no metadata in the repos to tell yum what is and what is not a security update. Thus it excludes everything.
Would you have any other suggestions that I might try, other than to do a full update on the servers?
Cherrypicking updates is unsupported and will likely break things. A point release is tested as a whole thing and no tests are run against updating bits of it. It's all or nothing and nothing will lead to compromise.

Also for the system that you say has the wrong running kernel but has 19.1.el7 installed, compare the output from rpm -qi kernel-3.10.0-1127.19.1.el7.x86_64 | grep -i install with the output from who -b to see if you just forgot to reboot after installing it.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

jxfish2
Posts: 24
Joined: 2013/03/08 15:07:48

Re: Incorrect Kernel Version Displayed

Post by jxfish2 » 2020/09/18 19:17:07

Does the "yum --security update" work in RedHat, or does it also not do anything?

I do not want to update to later versions of Java, PHP, and so on.

Some of the development software we're working on, is tested with specific application versions.

Hence the reason why we want to update only critical / security related issues right now.

Is there a way to do this in CentOS?

Is there a way to do this in RedHat? ( I am assuming that the --security update works in RedHat. )

User avatar
TrevorH
Forum Moderator
Posts: 29681
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Incorrect Kernel Version Displayed

Post by TrevorH » 2020/09/18 19:20:54

Does the "yum --security update" work in RedHat, or does it also not do anything?
Yes, it works on RHEL. It's one of the things you pay them for.
I do not want to update to later versions of Java, PHP, and so on.
You know that the versions of things in CentOS/RHEL are fixed at the initial release date - so for CentOS 7, in 2014. Red Hat backport patches from newer versions and also fix bugs but the version stays the same throughout the entire 10 year lifespan of the distro. With a few exceptions, mostly things like firefox which get rebased to the latest ESR version when that comes out. What you get by running yum update are security and bug fixes, not usually version updates. It's the whole point of running RHEL/CentOS - things stay the same for 10 years at a time.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - Software Support”