Kernel not updating

Hi Team,

We are updating the kernel version but still uname -r is saying the older version. Appreciate your help in advance.

Please find the below details.
1.) uname -r
5.14.0-362.13.1.el9_3.x86_64

2.)yum list kernel
Last metadata expiration check: 1:14:15 ago on Tue 17 Dec 2024 04:05:53 AM UTC.
Installed Packages
kernel.x86_64 5.14.0-362.13.1.el9_3 @baseos
kernel.x86_64 5.14.0-503.15.1.el9_5 @baseos
kernel.x86_64 5.14.0-503.16.1.el9_5 @baseos

Please let me know if you need any more details.

You did reboot after installing new kernel?

If you did, then issue is that bootloader continues to select the old kernel. The default is to use latest kernel.

Does the bootloader’s (GRUB) menu show all installed kernels?

1 Like

yeah i rebooted after installing the new kernel. But its still showing older version.

Can you help me with the command to check the bootloader ?

Please find the below output

cmd# rpm -qa kernel*
kernel-modules-core-5.14.0-362.13.1.el9_3.x86_64
kernel-core-5.14.0-362.13.1.el9_3.x86_64
kernel-modules-5.14.0-362.13.1.el9_3.x86_64
kernel-modules-core-5.14.0-503.15.1.el9_5.x86_64
kernel-core-5.14.0-503.15.1.el9_5.x86_64
kernel-modules-5.14.0-503.15.1.el9_5.x86_64
kernel-5.14.0-503.15.1.el9_5.x86_64
kernel-modules-extra-5.14.0-503.15.1.el9_5.x86_64
kernel-modules-core-5.14.0-503.16.1.el9_5.x86_64
kernel-core-5.14.0-503.16.1.el9_5.x86_64
kernel-modules-5.14.0-503.16.1.el9_5.x86_64
kernel-5.14.0-503.16.1.el9_5.x86_64
kernel-modules-extra-5.14.0-503.16.1.el9_5.x86_64
kernel-tools-libs-5.14.0-503.16.1.el9_5.x86_64
kernel-tools-5.14.0-503.16.1.el9_5.x86_64
kernel-headers-5.14.0-503.16.1.el9_5.x86_64

cmd# dnf rq --installonly
kernel-0:5.14.0-503.15.1.el9_5.x86_64
kernel-0:5.14.0-503.16.1.el9_5.x86_64
kernel-core-0:5.14.0-362.13.1.el9_3.x86_64
kernel-core-0:5.14.0-503.15.1.el9_5.x86_64
kernel-core-0:5.14.0-503.16.1.el9_5.x86_64
kernel-modules-0:5.14.0-362.13.1.el9_3.x86_64
kernel-modules-0:5.14.0-503.15.1.el9_5.x86_64
kernel-modules-0:5.14.0-503.16.1.el9_5.x86_64
kernel-modules-core-0:5.14.0-362.13.1.el9_3.x86_64
kernel-modules-core-0:5.14.0-503.15.1.el9_5.x86_64
kernel-modules-core-0:5.14.0-503.16.1.el9_5.x86_64
kernel-modules-extra-0:5.14.0-503.15.1.el9_5.x86_64
kernel-modules-extra-0:5.14.0-503.16.1.el9_5.x86_64

cmd# ls -l /boot/loader/entries/
total 8
-rwx------ 1 root root 459 Dec 17 02:14 b46f2cd9ff914485be77cf0f3c567a64-5.14.0-503.15.1.el9_5.x86_64.conf
-rwx------ 1 root root 459 Dec 17 04:42 b46f2cd9ff914485be77cf0f3c567a64-5.14.0-503.16.1.el9_5.x86_64.conf
cmd# efibootmgr
EFI variables are not supported on this system.
cmd# grubby --default-kernel
grep DEFAULT /etc/default/grub
grub2-editenv list
/boot/vmlinuz-5.14.0-503.16.1.el9_5.x86_64
GRUB_DEFAULT=saved
boot_success=1
saved_entry=AlmaLinux (5.14.0-503.16.1.el9_5.x86_64) 9.5 (Teal Serval)
cmd# grep DEFAULT /etc/default/grub
GRUB_DEFAULT=saved
cmd# grub2-editenv list
boot_success=1
saved_entry=AlmaLinux (5.14.0-503.16.1.el9_5.x86_64) 9.5 (Teal Serval)
cmd# uname -r
5.14.0-362.13.1.el9_3.x86_64

Hi Team,

Can you kindly help on this as this a blocker for us to proceed further ? Thanks in advance.

It looks like that there are only two files in /boot/loader/entries/:

b46f2cd9ff914485be77cf0f3c567a64-5.14.0-503.15.1.el9_5.x86_64.conf
b46f2cd9ff914485be77cf0f3c567a64-5.14.0-503.16.1.el9_5.x86_64.conf

If so, the entry for 5.14.0-362.13.1.el9_3.x86_64 is not there.


Interesting. I would have expected:

boot_success=1
saved_entry=b46f2cd9ff914485be77cf0f3c567a64-5.14.0-503.16.1.el9_5.x86_64

I have in /etc/default/grub (among other lines):

GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=menu
GRUB_DEFAULT=saved
GRUB_ENABLE_BLSCFG=true

Lets assume that something is not right with the grub.cfg. I’d recreate it after making sure that I have those lines in the /etc/default/grub:

sudo grub2-mkconfig --update-bls-cmdline -o /boot/grub2/grub.cfg
sudo grub2-editenv - set menu_auto_hide=0
sudo grubby --set-default=/boot/vmlinuz-5.14.0-503.16.1.el9_5.x86_64

The mkconfig rewrites the grub.cfg and updates cmdline options in the BLS entries.
The editenv tells GRUB to show the menu at boot.
The grubby sets the default once more.

What does grub2-editenv list tell afterwards?
Do you see (for 5 seconds) the GRUB menu before OS loads?
Which kernel is default/gets loaded?

1 Like

i have updated as below and run the below commands.
cmd :- cat /etc/default/grub
GRUB_CMDLINE_LINUX=“console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295”
GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=menu
GRUB_DEFAULT=saved
GRUB_ENABLE_BLSCFG=true

  1. sudo grub2-mkconfig --update-bls-cmdline -o /boot/grub2/grub.cfg
    3.sudo grub2-editenv - set menu_auto_hide=0
  2. sudo grubby --set-default=/boot/vmlinuz-5.14.0-503.16.1.el9_5.x86_64

5 .grub2-editenv list
boot_success=1
saved_entry=b46f2cd9ff914485be77cf0f3c567a64-5.14.0-503.16.1.el9_5.x86_64
next_entry=1
menu_auto_hide=0

After reboot its loaded with Alma 9.3 kernel version. Let me know if you need any more details.

I have added the above changes and i can see the OS is loading with 5.14.0-362.13.1.el9_3. Additionally when i checked in /boot directory i cant see any files related to 9.5 .I tried reinstallting the kernel version but its same.,

/boot
-rw-r–r–. 1 root root 219468 Dec 21 2023 config-5.14.0-362.13.1.el9_3.x86_64
-rw-r–r–. 1 root root 219448 Nov 7 2023 config-5.14.0-362.8.1.el9_3.x86_64
drwx------ 5 root root 16384 Jan 1 1970 efi
drwx------. 5 root root 79 Dec 18 05:37 grub2
-rw-------. 1 root root 45208110 Jan 10 2024 initramfs-5.14.0-362.13.1.el9_3.x86_64.img
-rw-------. 1 root root 45231328 Nov 16 2023 initramfs-5.14.0-362.8.1.el9_3.x86_64.img
drwxr-xr-x. 3 root root 21 Nov 16 2023 loader
lrwxrwxrwx. 1 root root 52 Jan 10 2024 symvers-5.14.0-362.13.1.el9_3.x86_64.gz → /lib/modules/5.14.0-362.13.1.el9_3.x86_64/symvers.gz
lrwxrwxrwx. 1 root root 51 Nov 16 2023 symvers-5.14.0-362.8.1.el9_3.x86_64.gz → /lib/modules/5.14.0-362.8.1.el9_3.x86_64/symvers.gz
-rw-------. 1 root root 8492936 Dec 21 2023 System.map-5.14.0-362.13.1.el9_3.x86_64
-rw-------. 1 root root 8491113 Nov 7 2023 System.map-5.14.0-362.8.1.el9_3.x86_64
-rwxr-xr-x. 1 root root 13373528 Dec 21 2023 vmlinuz-5.14.0-362.13.1.el9_3.x86_64
-rwxr-xr-x. 1 root root 13372728 Nov 7 2023 vmlinuz-5.14.0-362.8.1.el9_3.x86_64

Fascinating. Note also:

The “dnf rq” and “rpm” did not show 5.14.0-362.13.1.el9_3, but the original “yum list” did. (The yum is mere symlink to dnf.)
None of them lists 5.14.0-362.8.1.el9_3

I would uninstall the installonly packages of 5.14.0-503.15.1.el9_5 and 5.14.0-503.16.1.el9_5.

Then check what is in /boot/loader/entries, what does grub2-editenv list show, and whether system can still boot.

Do you see the GRUB menu on boot? What entries does it show?

Is this system a VM?

PS. The use of code tags (the </> button) can make posts more readable. (I’ve used them in above quotes too.)