Set a kernel as default

To set a specific kernel as the default, use the grubby command-line tool and GRUB configuration.

Procedure

  • Setting the kernel as default by using the grubby tool.
    • Enter the following command to set the kernel as default using the grubby tool:
      # grubby --set-default $kernel_path
  • Setting the kernel as default by using the version argument.
    • List the boot entries using the kernel keyword and then set an intended kernel as default:
      # select k in /boot/vmlinuz-*; do grubby --set-default=$k; break; done
      Note

      To list the boot entries using the title argument, enter # grubby --info=ALL | grep title.

  • Setting the default kernel for only the next boot.
    • Enter the following command to set the default kernel for only the next reboot using the grub2-reboot command:
      # grub2-reboot <index|title|id>
      Warning

      Set the default kernel for only the next boot with care. Installing new kernel RPMs, self-built kernels, and manually adding the entries to the /boot/loader/entries/ directory might change the index values.