To get the index number of all the installed kernels:
sudo grubby --info=ALL | grep -E "^kernel|^index"
The output should be something like this:
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"
Now we can change the default kernel by using the index number:
sudo grubby --set-default-index=1
Verify that the right kernel has been set as default:
sudo grubby --default-title
The output will be the default kernel title:
Fedora Linux (5.15.10-lqx1.0.fc35.x86_64) 35 (Workstation Edition)
2 Likes