Updating the exact kernel version you want to use in Ubuntu can become a little tricky, especially with GRUB listing Ubuntu image names, instead of numbers. So, here’s what we need to do if we want a particular Linux kernel version to be the default OS option. Here let’s try to make ubuntu 4.4.0.34 the default version. This works both for upgrading to newer kernel and downgrading to an older kernel versions.

  1. Back up the original grub to repair in case we end up bricking the system.

sudo cp /etc/default/grub /etc/default/grub.bak

2. To get the exact Ubuntu image name, use grub-mkconfig. It generates a configuration file from grub.cfg. Run grub-mkconfig and search for “menuentry” to get the list of images recognized by the GRUB, as shown in the screenshot below. Note that for any particular version, menuentries with (recovery mode) in their names are not the same as menuentries without them.

sudo grub-mkconfig

3. The default boot option is retrieved in GRUB_DEFAULT=xx. This is the line we need to modify. The updated string will be “submenu>menuentry” from step 2.

sudo vim /etc/default/grub.

GRUB_DEFAULT=”Advanced options for Ubuntu>Ubuntu, with Linux 4.4.0-34-generic”

4. Finally update the grub and reboot the machine. Once rebooted, verify that correct version was booted up.

sudo update-grub

sudo reboot now

uname -r —> This should now say 4.4.0-34-generic