User Tools

Site Tools


Sidebar

linux:change_boot_kernel

This is an old revision of the document!


Change the Default Kernel Version Permanently on CentOS 7

First, list all available kernel images added to GRUB2 by running the following command.

$ grep '^menuentry' /boot/grub2/grub.cfg

Identify the GRUB menu entry for the kernel that you want to set as default. Each menu entry is assigned by GRUB2 a numeric value starting from 0 in an increasing order. That is, the first menu entry assigned 0, the second entry assigned 1, etc. For example, the menu entry value for the kernel 3.10.0-327 is 2 in the above screenshot.

Open /etc/default/grub with a text editor, and set GRUB_DEFAULT to the numeric entry value for the kernel you chose as the default. In this example, I choose the kernel 3.10.0-327 as the default kernel.

GRUB_DEFAULT=2

Finally, re-generate GRUB configuration.

$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Reboot and confirm that the specified kernel is selected by GRUB2 by default.

linux/change_boot_kernel.1620934501.txt.gz · Last modified: 2021/05/13 21:35 by admin