Grub menu doesn't show the latest kernels after upgrade


The title say’s it all after upgrading to fedora 35 and lately 36 the grubmenu doesn’t show the latest kernel available. Instead I am still stuck on the fedora 34 kernel. However the latest kernels are actually installed. This is confirmed according to the output given by the following terminal commands:
(base) [ejan@fedora ~]$ rpm -q kernel-core

(base) [ejan@fedora ~]$ uname -a
Linux fedora 5.12.15-300.fc34.x86_64 #1 SMP Wed Jul 7 19:46:50 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
This leaves me confused about whatever the reason could be that the grubmenu only shows the initial kernel. Can anyone make sense of this issue? Please tell me.

1 Like

How did you do the upgrade? Did you use the dnf system-upgrade path or did you use the gnome-software gui? or did you do something else?

I personally always use dnf system-upgrade and have never had an issue with the way grub updates and displays the menu.

I also always do the recommended dnf upgrade --refresh step before I do the dnf system-upgrade download --releasever=## step. This usually means that for each fedora version installed I have a minimum of 2 kernel versions installed before I upgrade to the next release version as can be seen with dnf list installed kernel

If you do cat /etc/default/grub what do you see? On mine which always boots to the latest installed kernel I see GRUB_DEFAULT=saved
It would seem that you may have something different since you always boot to the same installed fedora 34 kernel. (dnf never replaces the currently running kernel so if booted to that kernel when upgrading it never will be replaced)

Hey Jeff, Thanks for your reply! I did indeed use the terminal based upgrade following this official fedora guide. So I have passed all the steps you suggested and I did have at least 2 kernel versions at the moment of upgrading.

[root@fedora ~]# dnf list installed kernel
Installed Packages
kernel.x86_64                     5.12.15-300.fc34                      @updates
kernel.x86_64                     5.17.3-302.fc36                       @fedora 
kernel.x86_64                     5.17.4-200.fc35                       @updates

And this is the data from the grub file:

[root@fedora ~]# cat /etc/default/grub
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_CMDLINE_LINUX="resume=UUID=25baa163-7ca8-4ed2-95be-94edfd0df139 rd.luks.uuid=luks-ba29ef9d-babb-4c69-9435-97ae55fea183 rhgb quiet"

This is mine, and other than 1 extra line, 1 line commented out, and the cmdline they seem similar.

GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_CMDLINE_LINUX="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rhgb quiet "

You also have GRUB_ENABLE_BLSCFG=false

I don’t really see anything specific to cause it to always boot to the F34 kernel here but the fact that you have #GRUB_TERMINAL_OUTPUT="console" may affect how or if you can even see the grub menu and select which kernel to boot.

Lets look at /etc/dnf/dnf.conf. Mine shows:

# cat /etc/dnf/dnf.conf

Does the menu actually show up for five seconds when you boot? If so, what happens if you select a different kernel?

1 Like

Good point. If the grub menu does not show up then he can still bring it up by holding down the ‘shift’ key while first powering on.

It may be or not. It has to do with the grub theme. These were install instructions of the Big Sur grub theme. If I wouldn’t have altered those values the graphical grub theme will not display.

Here’s the content of the dnf.conf:

[root@fedora ~]#  cat /etc/dnf/dnf.conf

It does show, really :smile: I can select the fedora 34 kernel, a resque mode kernel, windows 10 (dual boot) and the BIOS.

What happens if you select either the F 35 or F 36 kernels?

I can’t select either of those from the grub menu, it’s only F 34 unfortunately. Or do you know any alternative way to select the latest kernel?

I will bet I know the cause.

Please post the output of cat /boot/efi/EFI/fedora/grub.cfg

If it does not show similar to this then it has been overwritten and needs to be restored to default.

# cat /boot/efi/EFI/fedora/grub.cfg
search --no-floppy --fs-uuid --set=dev bd615d70-0ff8-42b6-ab38-0a7429b9bb91
set prefix=($dev)/grub2
export $prefix
configfile $prefix/grub.cfg

It does seem to be similar:

[root@fedora ~]# cat /boot/efi/EFI/fedora/grub.cfg
search --no-floppy --fs-uuid --set=dev 04e857a5-1f2d-4612-951f-66413101ffcd
set prefix=($dev)/grub2
export $prefix
configfile $prefix/grub.cfg

OK, then lets try rebuilding the grub.cfg file.
grub2-mkconfig -o /boot/grub2/grub.cfg
followed by a reboot to see if the grub menu has changed.

If it does not change then try
dnf reinstall grub* followed by a reboot.

That did fix the problem of the grubmenu not showing the latests kernels. Now I can select either of the three kernels available.

Thank you very much for the support. :+1:

Have you tried using the up and down arrow keys on the keyboard? That’s been the way to select which kernel to boot for many years.

He just said it is fixed. 25 minutes before your post.

Yes, I know. However, I felt it important to ask so that when other people looked here for help, they’d see that they needed to try to boot from other kernels to find out what works and what doesn’t.

6 posts were split to a new topic: Problem with new kernel boot loader