Hello there. I’m using f37 on my surface pro, and today I find that my grub is not updating boot menu after dnf updates. It only shows up previous kernels (such as 6.1.6 and 6.1.7) way older than newest ones installed (such as 6.2.6 and 6.2.8), and the old ones are kept installed.
I tried the same resolution for another issue(where my grub also not updating boot menu, but the old kernel have been autoremoved so it’s not booting), but it’s not working.
Some time back that file was switched to become a pointer to redirect grub to the actual grub.cfg file located at /boot/grub2/grub.cfg.
When users overwrite the stub pointer file then updates are never seen because the system updates the file under /boot/grub2 and the file under /boot/efi is static as far as the system is normally concerned.
The fix has been as noted in this doc
The pertinent section would be under the heading Reinstalling GRUB 2 and the subheading Resetting and Reinstalling GRUB 2
That instruction is missing the need to remove /boot/grub2/grub.cfg and /boot/efi/EFI/fedora/grub.cfg. The reinstall will verify the files exist and if not rebuilds them. If they exist it does not rebuild them. Step 3 in that instruction should read dnf reinstall grub2-efi* shim grub2-common but otherwise is fully correct.
With this fix the system should now automatically update the grub menu according to installed kernel.
The alternative is the user must manually run the grub2-mkconfig command with every kernel install/update to update the /boot/efi/EFI/fedora/grub.cfg file. This is not the recommended procedure since that file is designed to remain static and is normally only a pointer. It is always best to have the system manage the updates for you.
While I cannot say for certain, the line in /etc/default/grub which has GRUB_DEFAULT="/boot/vmlinuz*surface*"
may have an impact on the update of the grub menu.
If that kernel version is replaced or does not change then the grub menu may not see any changes since the default for dnf is to only keep the latest 3 kernels.
It also may be a bug in grub. I have noted in the past that even when I have changed the entry in /etc/dnf/dnf.conf from installonly_limit=3 to installonly_limit=4 that the grub menu still only displays the latest 3 kernels even when 4 are actually available to boot.
My first guess for those symptoms would be an error in /etc/fstab so that either the wrong partition is mounted as /boot or the wrong partition is mounted as /boot/efi
I would look at those entries in /etc/fstab and I would use the following command to get a clear picture of the partitions: lsblk -o NAME,FSTYPE,SIZE,LABEL,FSSIZE,FSUSE%,UUID,MOUNTPOINTS
If that doesn’t identify the problem, the next place I would look to try to diagnose is sudo grep linux /boot/loader/entries/*
Your list does not display the kernel packages which are meta packages that pull in all the others when updates are done (and may run needed scripts during the install). Every install I have ever done has installed that package and every kernel version update has updated it.
Even this list from a VM I installed a couple days ago shows that package installed by anaconda during the install.
Thank all of you! I remember I did “sudo dnf remove --duplicates” since conflicts in updating, so probably this removed my kernel. I (re)installed my kernel and kernel-surface and the newest versions installed shows up in my grub menu.