Ubuntu system keeps updating the kernel version. After some time there are multiple versions in your system and Linux boots up with the latest kernel version.
However, sometimes you might face some issues with the kernel version your system is using. You might want to revert to the previous version of the kernel. But you are unable to see the kernel options during the booting process.
Updating the Grub file.
/etc/default/grub and edit it.
Comment the line
GRUB_TIMEOUT to any number larger than 0.
This will start showing the grub menu on the startup and let you choose the correct Linux kernel version to boot.
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
Save the file and run the command
Now when the system is started next time, you will see the grub menu. Go to the ‘advance’ options, 2nd entry in the first menu. On the next screen, select the previous version of the kernel.
Permanently set the working kernel version:
If you left the system unattended after switching it on, by default first kernel version will be selected and the system will boot up with it. To set the desired version of kernel pre-selected at boot time, edit the above file again and change the line
GRUB_DEFAULT="1>4", where 1 and 4 are the entry indexes in the grub menu.
On the first screen, the ‘advance’ option is the 1st entry (starting from 0) and on the second screen, desired Linux kernel entry index is 4 (again starting from 0).
Save the file and run the
update-grub command once again.
Now next time whenever the system is started, the correct kernel version will be preselected and the system will boot with the selected kernel version in 15 seconds.
If you don’t need 15 seconds to select the kernel version as it is pre-selected, you can set the GRUB_TIMEOUT value back to 0.