My OS version is Ubuntu 20.04 LTS. Recently I got a kernel update to version 5.8.0-38 but then I was facing a lot of hardware issues. Now I am temporarily on kernel version 5.8.0-36 generic. How do I set this particular version as default. I am completely new to Linux.
3 Answers
The simplest solution might be to enable Grub's GRUB_SAVEDEFAULT
feature. Try this:
- Open the Terminal
- Edit the
/etc/default/grub
file:sudo vi /etc/default/grub
- Change
GRUB_DEFAULT=0
toGRUB_DEFAULT=saved
- Add
GRUB_SAVEDEFAULT=true
- Save the file (Esc⇢:⇢W⇢X
- Update Grub with:
sudo update-grub
These settings will ensure that your system boots with the last kernel you chose during boot.
Now reboot, hold the shift key when your system comes back up. You should then see the Grub menu. Choose the Kernel that works for you. That will now be "default".
Hope this gives you what you need.
-
This saved my day. I was trying to switch to the other kernel on my ubuntu 20 VM as I messed up the original kernel/build folder. Thanks. – anupx73 Jun 17 '21 at 14:50
-
This is the solution. Congrats! – Adail Junior Jan 19 '22 at 22:15
If you'd like to always boot specific version by default you should
- Edit
/etc/default/grub
file. FindGRUB_DEFAULT
and specify path to the grub menu entry (something likeGRUB_DEFAULT='Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-48-generic'
) - Run
update-grub
.
Note 1. You can find grub menu entries in /boot/grub/grub.cfg
.
Note 2. I recommend to make a copy of /etc/default/grub
before modification.
You can also check this link - I've created a note for myself some time ago.

- 2,426

- 334
-
Thank you, this works even when an additional kernel is installed (numbering 1>2 breaks in such cases). – spawn Jun 17 '21 at 09:16
I downgraded kernel version to install an old version of Nvidia driver. After the steps given by user1091774, I find that it is necessary to run sudo update-initramfs -u
, otherwise DKMS still tries to build Nvidia driver against the latest version of kernel.