Changing the Default Kernel

The default kernel is the kernel that GRUB2 boots into after a timeout period is reached when displaying the GRUB2 boot menu.

You can follow one of two options to set the default kernel in GRUB 2, by using the grubby command, choose either of the following:

  • Use the grubby --set-default command to set the default kernel.

    To switch to a different default kernel, run the following command making sure to specify the full path to the selected default kernel:

    sudo grubby --set-default /boot/vmlinuz-5.15.0-208.159.3.2.el8uek.x86_64

    The change takes effect immediately and persists across system reboots.

  • Use the grubby --set-default-index command to set the default kernel to match the kernel at a particular index point in the in the kernel boot list. The index values are displayed when you run the grubby --info command

    For example, you can use the --set-default-index=0 option to set the default kernel to the first kernel listed in the kernel boot index by running:

    sudo grubby --set-default-index=0