Using grubby to Manage Kernels
Use the grubby command to manage the GRUB 2 configuration on the system, including selecting the default boot kernel or configuring extra kernel command line boot parameters to be used at boot.
See the grubby(8) manual page for more information.
Checking Available Kernels on the System
Kernels are named to include the upstream version number, the distribution build, and the kernel family.
See About Linux Kernels for extra context.
Several methods are available for checking which kernels are available on a system:
Comparing the Default Kernel to the Running Kernel
The running kernel and the kernel configured as the default kernel that GRUB 2 selects to boot into after a timeout period for the boot menu can differ.
If the default kernel version and the running kernel version aren't identical, the underlying reasons might be one of the following:
A newer kernel is installed, but the system hasn't been rebooted.
During a system reboot, a different kernel was manually selected to be the operative kernel.
The default kernel was manually updated but the system hasn't been rebooted after the update.
Changing the Default Kernel
Use grubby to set the default kernel that GRUB2 boots into after a timeout period is reached when displaying the GRUB2 boot menu.
You might change the default kernel from RHCK to UEK, from UEK to RHCK, or to switch to a specific kernel version.
You can follow one of two options to set the default kernel in GRUB 2, by using the grubby command, do either of the following:
Switch to the Most Recent Available RHCK or UEK Kernel
By using the naming convention to identify UEK kernels and RHCK kernels that are available
in the /boot directory, you can easily switch the default kernel to use
the most recent version of either kernel type.
-
To switch to the most recent version of UEK on the system, run:
sudo grubby --set-default $(ls /boot/vmlinuz-* | grep 'uek' | sort -V | tail -1) -
To switch to the most recent version of RHCK on the system, run:
sudo grubby --set-default $(ls /boot/vmlinuz-* | grep -v 'uek' | sort -V | tail -1)
Reboot the system after setting the default kernel to switch to that kernel type.
Changing Kernel Command Line Boot Parameters
You can update the GRUB 2 boot configuration for a specific kernel, or across all kernels that are installed on the system by doing the following:
Checking the Kernel Command Line Last Used to Boot The System
The kernel boot parameters that were last used to boot a system are recorded in
/proc/cmdline.
For more information, see the kernel-command-line(7) manual page.
/proc/cmdline to view the kernel
command line that was used to boot the running system.
cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-5.15.0-208.159.3.2.el9uek.x86_64
root=UUID=72dfa724-5feb-49e2-8869-40625bfebb01 ro
resume=UUID=13078314-ebff-4c44-b18c-3445f6802198
rd.luks.uuid=luks-a80f8f10-75b6-45de-b63e-64b8b6a3a94b
rhgb quiet crashkernel=1G-64G:448M,64G-:512M