Issue
Ubuntu: Install a Previous Kernel
sudo apt install linux-image-5.19.0-1024-aws
Ubuntu: Install Kernel and Set GRUB Default Kernel
Install Kernel
Install the default kernel:
sudo apt install linux-generic
Set GRUB Default Kernel
- Find entrance from
/boot/grub/grub.cfg
- Get the $menuentry_id_option:Example output:
grep submenu /boot/grub/grub.cfg
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-4591a659-55e2-4bec-8dbe-d98bd9e489cf' {
'gnulinux-advanced-4591a659-55e2-4bec-8dbe-d98bd9e489cf'
is what we need. - Get the specific kernel option:Example output:
grep gnulinux-4.15.0 /boot/grub/grub.cfg
menuentry 'Ubuntu, with Linux 4.15.0-126-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-126-generic-advanced-4591a659-55e2-4bec-8dbe-d98bd9e489cf' {
'gnulinux-4.15.0-126-generic-advanced-4591a659-55e2-4bec-8dbe-d98bd9e489cf'
is what we need.
- Get the $menuentry_id_option:
- Set GRUB_DEFAULT in
/etc/default/grub
- Join two entry strings obtained above by '>', set to
GRUB_DEFAULT
.GRUB_DEFAULT='gnulinux-advanced-4591a659-55e2-4bec-8dbe-d98bd9e489cf>gnulinux-4.15.0-126-generic-advanced-4591a659-55e2-4bec-8dbe-d98bd9e489cf'
- Join two entry strings obtained above by '>', set to
- Update grub
sudo update-grub
- Reboot the machine