How is Grub updated after each kernel upgrade?

14,398

The installer just runs update-grub when any Kernel-package activity happens. This completely rebuilds the grub bootloader (ie it doesn't update single records).

And yes, they are listed by descending version. You can see the listing in the "Ubuntu (advanced)" grub listing... But otherwise, the top one is taken.

The easiest fix for you is to just remove the kernel packages you installed. update-grub should be run automatically and the default should return to a maintained line.

If you want to keep the newer kernel version but just default to a stable one, here is a great tutorial on manually setting the default kernel version. You should be able to specify "2>3" which should pick the next highest Kernel underneath your upstream one, so this should also track them as updates are installed.

Share:
14,398

Related videos on Youtube

tmt
Author by

tmt

Updated on September 18, 2022

Comments

  • tmt
    tmt over 1 year

    How I think I got into the problem

    After the system installation I proceeded to install upstream kernel, changed /etc/initramfs-tools/conf.d/resume by commenting out the RESUME... line and then I run update-initramfs -u. While I now realize that this was probably unnecessary, I did it while following an article describing the system setup with automatically decrypted partitions.

    Problem

    The default Grub entry now points to the upstream image instead of the latest one coming from Ubuntu and it does not get updated when a new image is installed during upgrades.

    I'd like to stop using the upstream image and go with whatever latest image is installed. Obviously, I can always pick it manually from the Grub menu during boot but I'd like the default entry to get updated automatically.

    Questions

    Q1: Is the fact that the default entry points to the kernel with higher version preventing the installer to upgrade the entry?

    Q2: How does the installer actually know which entry to update?

    Notes

    I admit I have limited knowledge of Grub and the system in general. Feel free to point out and explain any misconceptions I might have stated.

  • tmt
    tmt over 9 years
    Thanks for your input and explanation on the update process. However, I'd like to keep that upstream image. What would you recommend then?
  • Oli
    Oli over 9 years
    That's more fiddly but possible
  • tmt
    tmt over 9 years
    Thank you for your time! I'll go through it all, give it a try and get back to your answer in a couple of days.