INFORMATICS

The Best

change default kernel version RHEL/CentOS 8

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

change default kernel version RHEL/CentOS 8

List installed kernel versions

[root@b1s ~]# rpm -qa | grep kernel | sort
kernel-4.18.0-193.28.1.el8_2.x86_64
kernel-4.18.0-240.10.1.el8_3.x86_64
kernel-4.18.0-240.1.1.el8_3.x86_64
kernel-core-4.18.0-193.28.1.el8_2.x86_64
kernel-core-4.18.0-240.10.1.el8_3.x86_64
kernel-core-4.18.0-240.1.1.el8_3.x86_64
kernel-devel-4.18.0-193.28.1.el8_2.x86_64
kernel-devel-4.18.0-240.10.1.el8_3.x86_64
kernel-devel-4.18.0-240.1.1.el8_3.x86_64
kernel-headers-4.18.0-240.10.1.el8_3.x86_64
kernel-modules-4.18.0-193.28.1.el8_2.x86_64
kernel-modules-4.18.0-240.10.1.el8_3.x86_64
kernel-modules-4.18.0-240.1.1.el8_3.x86_64
kernel-tools-4.18.0-240.10.1.el8_3.x86_64
kernel-tools-libs-4.18.0-240.10.1.el8_3.x86_64
[root@b1s ~]# grubby --info=ALL | grep ^kernel
kernel="/boot/vmlinuz-4.18.0-240.10.1.el8_3.x86_64"
kernel="/boot/vmlinuz-4.18.0-240.1.1.el8_3.x86_64"
kernel="/boot/vmlinuz-4.18.0-193.28.1.el8_2.x86_64"
kernel="/boot/vmlinuz-0-rescue-7919fe4e4b09483bab8b9140dcd8a82e"

To check the currently active kernel version we will use uname with -r which will give us kernel release information:
[root@b1s ~]# uname -r
4.18.0-193.28.1.el8_2.x86_64


[root@b1s ~]# grubby --info="/boot/vmlinuz-4.18.0-193.28.1.el8_2.x86_64"
index=2
kernel="/boot/vmlinuz-4.18.0-193.28.1.el8_2.x86_64"
args="ro crashkernel=auto resume=/dev/mapper/cl_b1s-swap rd.lvm.lv=cl_b1s/root rd.lvm.lv=cl_b1s/swap rhgb quiet amd_iommu=on $tuned_params"
root="/dev/mapper/cl_b1s-root"
initrd="/boot/initramfs-4.18.0-193.28.1.el8_2.x86_64.img $tuned_initrd"
title="CentOS Linux (4.18.0-193.28.1.el8_2.x86_64) 8 (Core)"
id="7919fe4e4b09483bab8b9140dcd8a82e-4.18.0-193.28.1.el8_2.x86_64"

Check the kernel version which is going to be activated post reboot

[root@b1s ~]# grubby --grub2 --default-title
CentOS Linux (4.18.0-193.28.1.el8_2.x86_64) 8 (Core)

 

[root@b1s ~]# grubby --default-kernel
/boot/vmlinuz-4.18.0-193.28.1.el8_2.x86_64

 

# grubby --default-index
0

Change the default kernel 

 

[root@b1s ~]# grubby --set-default "/boot/vmlinuz-4.18.0-193.14.3.el8_2.x86_64"

 

Verify the new default kernel

# grubby --default-kernel
# grubby --default-index
# uname -r

 

 

Search