How to Change the Default Kernel on Fedora

To check and change the default kernel on Fedora, we’ll be utilizing a command line tool called “grubby”. This tool is specifically designed for modifying bootloader configuration files.

Install grubby

In case grubby is not already installed, we have the option to install it:

1
sudo dnf install grubby

List all installed kernels

To get the index number of all the installed kernels:

1
sudo grubby --info=ALL | grep -E "^kernel|^index"

The output should be something like this:

1
2
3
4
5
6
7
8
index=0
kernel="/boot/vmlinuz-5.15.10-200.fc35.x86_64"
index=1
kernel="/boot/vmlinuz-5.15.10-lqx1.0.fc35.x86_64"
index=2
kernel="/boot/vmlinuz-5.15.8-200.fc35.x86_64"
index=3
kernel="/boot/vmlinuz-5.15.8-lqx1.0.fc35.x86_64"

Change the default kernel using index

Now we can change the default kernel by using the index number:

1
sudo grubby --set-default-index=1

Verify the default kernel

Verify that the right kernel has been set as default:

1
sudo grubby --default-title

The output will be the default kernel title:

1
Fedora Linux (5.15.10-lqx1.0.fc35.x86_64) 35 (Workstation Edition)

How to Change the Default Kernel on Fedora

https://www.reisuke.com/change-default-kernel-fedora/

Author

Jun Kaiser

Posted on

2021-12-25

Updated on

2021-12-26

Licensed under

CC BY-SA 4.0

Comments