I could not find this easily today so I am putting it here for other people, and myself in 6 months

How do you roll back a kernel in ubuntu LTS 16.04, answered below

1 Answer 1


do the following steps in order

  1. ssh into the box
  2. sudo su -
  3. count the menu and submenu lines to get to the kernel you want to boot, indexed at 0
  4. edit /etc/default/grub
  5. change GRUB_DEFAULT=0 to GRUB_DEFAULT="M>N" and save
    • M is menu count
    • N is submenu count, the kernel you want to boot
    • ON 16.04 you start counting N when you get here: submenu 'Advanced options for Ubuntu'
  6. update-grub
  7. systemctl reboot
  8. ssh in
  9. uname -r to see if you booted to the right kernel
  10. sudo su -
  11. apt-get purge linux-headers-version_to_remove and linux-image-version_to_remove
  12. edit /etc/default/grub and change to: GRUB_DEFAULT=0
  13. systemctl reboot
  14. ssh in and uname -r to see if you are good

orignal article https://www.calazan.com/how-to-set-an-older-kernel-version-as-the-default-in-grub-during-bootup-ubuntu-12-04/

If you do this wrong you may not be able to boot the box, be warned

  • you may need to install an older kernel to roll back to the desired state
    – ms4720
    Jan 21, 2018 at 9:24
  • 1
    Or you can do it in two steps: 1) boot the older kernel. 2) uninstall the unwanted kernel. Jan 21, 2018 at 10:19
  • that is exactly what I am doing, could not find a simpler way to do it on cli, lots of info if you had X running
    – ms4720
    Jan 22, 2018 at 1:51
  • forgot to add this was AWS so no console
    – ms4720
    Jan 22, 2018 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.