Grub menu not updated after upgrading to F36

I just finished updating a system to F36. It did not go smoothly (/var got filled and dnf system-upgrade failed to remove a bunch of F35 packages). I’ve managed to clean up most of the mess, but the grub menu still shows a F35 kernel. I tried to update the menu manually with kernel-install but no luck. I get the following output and the grub menu remains the same as before.

$ sudo kernel-install add 5.17.6-300.fc36.x86_64 /lib/modules/5.17.6-300.fc36.x86_64/vmlinuz
dkms: running auto installation service for kernel 5.17.6-300.fc36.x86_64
Error! Could not locate dkms.conf file.
File: /var/lib/dkms/mba6x_bl/20150428.f1482dd/source/dkms.conf does not exist.
1 Like

That’s actually normal and it will drop off on its own after a few Fedora 36 kernels have been installed. A few old kernels are left just in case of emergency if you can’t boot to a new one.

The problem isn’t that the old kernels are still there, I know that’s normal. The problem is that there are no F36 kernels on the menu.

Are you able to run a dnf distro-sync ?

Yes. When I ran it yesterday dnf distro-sync did its checks and then said “Nothing to do” or something to that effect. I ran it again just now and it looks like it’s installing a new kernel. I’ll reboot after it’s done and see what happened to the grub menu.

After rebooting I find the oldest F35 kernel has been removed from the grub menu but nothing new has been added, even though dnf distro-sync installed a new kernel.

Oh, it sounds like my recent experience !
Problem to install a kernel
Can you check if you have new (expected vmlinuz) files in /boot ?

~> ls /boot

So it looks like there are no F36 kernels and only one F35 kernel in /boot, consistent with what shows up in the grub menu.

Yes. Same experience for me…

You can remove completely kernel 5.17.6-300.fc36.x86_64 with this command
sudo dnf erase kernel*5.17.6-300.fc36.x86_64

check in directory /boot and /boot/loader/entries this kernel entry must be gone.
login and open terminal type this:
sudo dnf update

restart. and then you must see new kernel Fedora 36 in your grub menu bootloader.

Yes, I did that.
I agree it should work as you describe, but it doesn’t !
No fc36 file, no new grub menu line.

That command has the side effect of removing a very large number of other packages, surely there’s a way to reinstall the kernel without triggering a mass removal of packages from the system.

Do you have tried it? This is not removing large packages dependency at least in my fedora 37 linux system. I think this is safe to do that. See my SS below

Interesting, it looks like you have several F37 kernels on your system. I don’t have that.

On my system I was able to remove and reinstall the most recent F36 kernel (5.17.7) without affecting other packages. But if I try to remove kernel 5.17.6-300.fc36 I get this:

sudo dnf remove kernel\*5.17.6\*fc36\* --noautoremove
Dependencies resolved.
 Package                        Arch   Version              Repository     Size
 kernel-core                    x86_64 5.17.6-300.fc36      @updates       89 M
 kernel-devel                   x86_64 5.17.6-300.fc36      @updates       63 M
 kernel-headers                 x86_64 5.17.6-300.fc36      @updates      5.7 M
 kernel-modules                 x86_64 5.17.6-300.fc36      @updates       52 M
 kernel-modules-extra           x86_64 5.17.6-300.fc36      @updates      3.2 M
Removing dependent packages:
 R                              x86_64 4.1.3-1.fc36         @fedora         0  
 R-core-devel                   x86_64 4.1.3-1.fc36         @fedora       391 k
 R-devel                        x86_64 4.1.3-1.fc36         @fedora         0  
 annobin-plugin-gcc             x86_64 10.71-1.fc36         @updates      879 k
 blas-devel                     x86_64 3.10.1-1.fc36        @updates       96 k
 boost-devel                    x86_64 1.76.0-11.fc36       @updates      135 M
 boost-static                   x86_64 1.76.0-11.fc36       @updates       49 M
 cegui-devel                    x86_64 0.8.7-24.fc36        @fedora        31 M
 clang                          x86_64 14.0.0-1.fc36        @fedora       184 k
 clang-devel                    x86_64 14.0.0-1.fc36        @fedora        17 M
 dkms                           noarch 3.0.3-2.fc36         @fedora       148 k
 ecl                            x86_64 21.2.1-5.fc36        @fedora        23 M
 freeglut-devel                 x86_64 3.2.2-1.fc36         @fedora       2.3 M
 gcc                            x86_64 12.1.1-1.fc36        @updates       91 M
 gcc-c++                        x86_64 12.1.1-1.fc36        @updates       34 M
 gcc-gdb-plugin                 x86_64 12.1.1-1.fc36        @updates      336 k
 gcc-gfortran                   x86_64 12.1.1-1.fc36        @updates       33 M
 gl2ps-devel                    x86_64 1.4.2-5.fc36         @fedora       256 k
 glibc-devel                    x86_64 2.35-6.fc36          @updates       97 k
 gobject-introspection-devel    x86_64 1.72.0-1.fc36        @fedora        13 M
 google-musicmanager-beta       x86_64 1.0.467.4929-0       @google-musicmanager
                                                                           16 M
 gtkglarea2-devel               x86_64 2.0.1-13.fc26        @@commandline  36 k
 hdf5-devel                     x86_64 1.12.1-5.fc36        @fedora       3.9 M
 imath-devel                    x86_64 3.1.5-1.fc36         @updates      3.8 M
 kernel-devel                   x86_64 5.17.6-200.fc35      @updates       62 M
 kmod-wl-5.17.6-300.fc36.x86_64 x86_64 @@commandline 1.7 M
 lapack-devel                   x86_64 3.10.1-1.fc36        @updates      1.6 M
 libdrm-devel                   x86_64 2.4.110-1.fc36       @fedora       606 k
 libquadmath-devel              x86_64 12.1.1-1.fc36        @updates       21 k
 libtool                        x86_64 2.4.6-50.fc36        @fedora       2.6 M
 libxcrypt-devel                x86_64 4.4.28-1.fc36        @fedora        30 k
 mesa-libGL-devel               x86_64 22.0.3-1.fc36        @updates       77 k
 mygui                          x86_64 3.2.2-13.fc32        @fedora        13 M
 mygui-devel                    x86_64 3.2.2-13.fc32        @fedora       2.1 M
 net-snmp-devel                 x86_64 1:5.9.1-14.fc36      @fedora       769 k
 net-snmp-gui                   x86_64 1:5.9.1-14.fc36      @fedora        31 k
 net-snmp-perl                  x86_64 1:5.9.1-14.fc36      @fedora       1.2 M
 netcdf-cxx-devel               x86_64 4.2-29.fc36          @fedora       1.4 M
 netcdf-devel                   x86_64 4.8.1-3.fc36         @fedora       400 k
 octave                         x86_64 6:6.4.0-5.fc36       @fedora        57 M
 octave-control                 x86_64 3.4.0-2.fc36         @fedora       3.5 M
 octave-io                      x86_64 2.6.4-2.fc36         @fedora       1.1 M
 octave-odepkg                  x86_64 0.9.1-0.18.20210827hg611.fc36
                                                            @fedora       1.8 M
 ogre-devel                     x86_64 1:1.9.0-40.fc36      @fedora       7.1 M
 openexr-devel                  x86_64 3.1.5-1.fc36         @updates      734 k
 openmpi-devel                  x86_64 4.1.2-3.fc36         @fedora       1.9 M
 perl                           x86_64 4:5.34.1-486.fc36    @fedora         0  
 perl-App-cpanminus             noarch 1.7046-1.fc36        @updates      249 k
 perl-CPAN                      noarch 2.34-1.fc36          @updates      1.9 M
 perl-ExtUtils-CBuilder         noarch 1:0.280236-479.fc36  @fedora        96 k
 perl-ExtUtils-Embed            noarch 1.35-486.fc36        @fedora        16 k
 perl-ExtUtils-Miniperl         noarch 1.10-486.fc36        @fedora       8.7 k
 perl-devel                     x86_64 4:5.34.1-486.fc36    @fedora       7.5 M
 pocl                           x86_64 1.8-1.fc36           @fedora        52 M
 python3-gobject-devel          x86_64 3.42.1-1.fc36        @updates       25 k
 python3-qt5-devel              x86_64 5.15.6-3.fc36        @fedora       2.7 M
 python3-theano                 noarch 1.1.2-3.fc36         @fedora        13 M
 qt-devel                       x86_64 1:4.8.7-67.fc36      @fedora        38 M
 qt3-devel                      x86_64 3.3.8b-90.fc36       @fedora        47 M
 qt5-qtbase-devel               x86_64 5.15.3-1.fc36        @fedora        19 M
 qt5-qtsvg-devel                x86_64 5.15.3-1.fc36        @fedora        84 k
 qt5-rpm-macros                 noarch 5.15.3-1.fc36        @fedora       1.6 k
 qwt-devel                      x86_64 6.1.5-6.fc36         @fedora       364 k
 redhat-lsb                     x86_64 4.1-56.fc36          @fedora       1.1 k
 redhat-lsb-languages           x86_64 4.1-56.fc36          @fedora       944  
 sundials                       x86_64 5.8.0-4.fc36         @fedora       5.8 M

Transaction Summary
Remove  71 Packages

Freed space: 1.0 G
Is this ok [y/N]: 
1 Like

can you manually remove them with individually with

sudo rpm -e --nodeps <kernel package> 

Not exactly like that, I use Fedora 37 or rawhide, I’ve upgraded yesterday from fedora 36 beta. The upgraded process is like fedora as usual flawlessly and smoothly haha :grin: I upgraded because I want to know if my old laptop which doesn’t support uefi still can upgrade to use fedora 37 in the future release, and at least I know it’s working well.
I also have tried your command above. but still no include large dependency when i tried to remove kernel 5.17.7-300.fc36 with your command above. see my SS below:

I expect that would remove it, but it seems kind of risky to use the --nodeps here.

It looks like the reason for the mass removal of packages was that 5.17.6 was the only version for the kernel-headers package. I learned in another thread that the kernel-headers package is not necessarily provided for every kernel; if no changes to userspace headers occurs in a new kernel release then the headers for the earlier kernel version can still be used. So I was able to remove kernel 5.17.6 with dnf remove kernel-core-5.17.6-300.fc36 and it only removed that kernel version and its modules and not dozens of other packages.


And the reason the grub menu didn’t update was that a bug in systemd kernel-install which causes it to put the kernel files in /boot/efi rather than in /boot. Fix was to delete /boot/efi/<machine id>. Details here: