How to set the default kernel version?
Environment
- Red Hat Enterprise Linux 10
- Red Hat Enterprise Linux 9
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 7
Issue
- How to set the default kernel version?
Resolution
-
To set a specific kernel as the default boot entry, use the
grubby --set-default <full path to kernel vmlinuz file>command.# grubby --set-default /boot/vmlinuz-5.14.0-427.33.1.el9_4.x86_64Note: The above command set the default kernel to version 5.14.0-427.33.1.el9_4.x86_64, replace the version with the version of the kernel to set as default.
Notes:
- List available kernels on the system using the
ls -1 /boot/vmlinuz-*command. grubbysets thesave_entryvalue in the/boot/grub2/grubenvfile to the specified kernel. For this to work, ensureGRUB_DEFAULT=savedis configured in the/etc/default/grubfile.- After setting the default kernel, reboot the system to boot into the newly configured default kernel.
Diagnostic Steps
- How to check the kernel version in use?
- How to check the default kernel version?
- Why is the system not using the kernel set with grubby?
SBR
Product(s)
Components
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.