Problem to install a F36 kernel

What do df -ai /boot and df -ah /boot report?

$ df -ai /boot
Filesystem     Inodes IUsed IFree IUse% Mounted on
/dev/sda2       96000   101 95899    1% /boot
$ df -ah /boot
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       1.5G  205M  1.2G  16% /boot

I am not aware of a disk space problem in my system.

$ df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 4.0M     0  4.0M   0% /dev
tmpfs                    7.8G   92M  7.7G   2% /dev/shm
tmpfs                    3.2G  1.7M  3.2G   1% /run
/dev/mapper/fedora-root   50G   24G   23G  51% /
tmpfs                    7.8G  132K  7.8G   1% /tmp
/dev/sda2                1.5G  205M  1.2G  16% /boot
/dev/mapper/fedora-home                    90% /home
/dev/sda1                400M  210M  190M  53% /boot/efi

I did not feel the upgrade from f35 to f36 was incomplete. How do I check that ? (I might have cleaned up many things already).

That tells me it is possible that the upgrade did not complete successfully. The fact that you booted to an F35 kernel is ?.
It is also possible that the mirrors are not fully in sync with the latest kernel upgrade. If the mirrors are out of sync then wait a while for them to update and try again.

What is the output of ls -l /boot?
You should see at least one F36 kernel as initramfs*fc36* and a matching vmlinuz*fc36*.

If not and you only have the ability to boot to the f35 kernel from grub that is its own issue. To verify things are coherent try dnf distro-sync and see if that does anything to make sure things are properly matching before you do anything more.

Everything is clean, no fc36 files in /boot

$ sudo dnf distrosync 
Last metadata expiration check: 0:48:23 ago on Wed 18 May 2022 03:29:13 PM CEST.
Dependencies resolved.
Nothing to do.
Complete!

$ ls -1 /boot
config-5.17.6-200.fc35.x86_64
efi
elf-memtest86+-5.31
extlinux
grub2
initramfs-0-rescue-cd4f994eec964edcbf828ed29c2967b4.img
initramfs-5.17.6-200.fc35.x86_64.img
initrd-plymouth.img
loader
lost+found
memtest86+-5.31
symvers-5.17.6-200.fc35.x86_64.gz
System.map-5.17.6-200.fc35.x86_64
vmlinuz-0-rescue-cd4f994eec964edcbf828ed29c2967b4
vmlinuz-5.17.6-200.fc35.x86_64

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

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

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

I dnf remove kernel*5.17.7* and update again. No success.
I downloaded the kernel-core-5.17.7-300.fc36.x86_64.rpm and rpm -ivh kernel-core-5.17.7-300.fc36.x86_64.rpm with the same “failure” : no expected files in /boot :frowning:

Attempting to install a kernel by downloading one specific rpm is fruitless and a waste of time. This is especially true when using rpm since that does not search for and install the dependencies needed. Dnf makes sure all the dependencies are available and installed.

It appears that definitely the upgrade did not complete successfully since it did not install the fc36 kernel.

Please try dnf list installed kernel and post that output here.
Also post the output of dnf remove kernel*5.17*fc36* and cat /etc/fedora-release

BTW, how did you do the upgrade from 35 to 36? Was it by using the gnome software app or by using dnf system-upgrade?

So weird

$ sudo dnf list installed kernel
Error: No matching Packages to list
$ sudo dnf list installed kernel*
Installed Packages
kernel-core.x86_64                                                                            5.17.6-200.fc35                                                                     @updates     
kernel-core.x86_64                                                                            5.17.6-300.fc36                                                                     @updates     
kernel-core.x86_64                                                                            5.17.7-300.fc36                                                                     @@commandline
kernel-devel.x86_64                                                                           5.17.6-200.fc35                                                                     @updates     
kernel-devel.x86_64                                                                           5.17.6-300.fc36                                                                     @updates     
kernel-devel.x86_64                                                                           5.17.7-300.fc36                                                                     @updates     
kernel-headers.x86_64                                                                         5.17.6-300.fc36                                                                     @updates     
kernel-srpm-macros.noarch                                                                     1.0-14.fc36                                                                         @fedora      
kernel-tools.x86_64                                                                           5.17.6-300.fc36                                                                     @updates     
kernel-tools-libs.x86_64                                                                      5.17.6-300.fc36                                                                     @updates     

But I see a lot of package could be removed with

$ sudo dnf remove kernel*5.17*fc36*
Dependencies resolved.
===============================================================================================================================================================================================
 Package                                                                       Architecture              Version                                             Repository                   Size
===============================================================================================================================================================================================
Removing:
 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-tools                                                                  x86_64                    5.17.6-300.fc36                                     @updates                    721 k
 kernel-tools-libs                                                             x86_64                    5.17.6-300.fc36                                     @updates                     32 k
Removing dependent packages:
...
 vala                                                                          x86_64                    0.56.1-1.fc36                                       @updates                    9.9 M
Removing unused dependencies:
 GraphicsMagick                                                                x86_64                    1.3.38-1.fc36                                       @updates                    4.9 M
...
Transaction Summary
===============================================================================================================================================================================================
Remove  221 Packages

Freed space: 1.2 G
Is this ok [y/N]: n
Operation aborted.

I used dnf system-upgrade to jump from f35 to f36.

$ cat /etc/fedora-release
Fedora release 36 (Thirty Six)

I am now in the 35.5 state !?
Do you suggest I remove the fc36 kernel and perform the dnf system-upgrade again ?
Why would this succeed this time ?
Regards

If you have old kernels taking up space on the drive, then you can delete them with the following script (from DNF System Upgrade):

#!/usr/bin/env bash

old_kernels=($(dnf repoquery --installonly --latest-limit=-1 -q))
if [ "${#old_kernels[@]}" -eq 0 ]; then
    echo "No old kernels found"
    exit 0
fi

if ! dnf remove "${old_kernels[@]}"; then
    echo "Failed to remove old kernels"
    exit 1
fi

echo "Removed old kernels"
exit 0

The DNF System Upgrade also has other tips for cleaning the old F35 installation after an upgrade.

Also note that the script dnf used to remove old kernels had a bug and it used to leave artifacts in /lib/modules. You can remove the old artifacts manually from /lib/modules once the kernels have been removed using dnf. Also see Issue 2016630, Removing old kernel-core leaves modules.builtin.alias.bin under /lib/modules.


For completeness, here is my /boot after a DNF System Upgrade to F36. I had 4 of them complete without trouble (and I always follow the official docs). After the reboot into the new kernel I remove all of the old kernels.

$ sudo ls -Al /boot
total 135180
-rw-r--r--  1 root root   244012 May 12 11:30 config-5.17.7-300.fc36.x86_64
drwx------  4 root root    16384 Dec 31  1969 efi
-rw-r--r--  1 root root   151452 Jan 27 06:54 elf-memtest86+-5.31
drwxr-xr-x. 2 root root     4096 May 10 22:59 extlinux
drwx------. 4 root root     4096 May  9 12:37 grub2
-rw-------. 1 root root 71061064 Apr 19  2019 initramfs-0-rescue-7caccc78a36f4e6cacc7961848f0650c.img
-rw-------  1 root root 37922612 May 17 16:24 initramfs-5.17.7-300.fc36.x86_64.img
drwxr-xr-x. 3 root root     4096 Oct 24  2018 loader
drwx------. 2 root root    16384 Apr 19  2019 lost+found
-rw-r--r--  1 root root   149856 Jan 27 06:54 memtest86+-5.31
lrwxrwxrwx  1 root root       46 May 17 16:22 symvers-5.17.7-300.fc36.x86_64.gz -> /lib/modules/5.17.7-300.fc36.x86_64/symvers.gz
-rw-------  1 root root  6235492 May 12 11:30 System.map-5.17.7-300.fc36.x86_64
-rwxr-xr-x. 1 root root 10795112 Jun  5  2020 vmlinuz-0-rescue-7caccc78a36f4e6cacc7961848f0650c
-rwxr-xr-x  1 root root 11800752 May 12 11:30 vmlinuz-5.17.7-300.fc36.x86_64
-rw-r--r--  1 root root      167 May 12 11:26 .vmlinuz-5.17.7-300.fc36.x86_64.hmac

I did follow the docs, the problem is not old kernels. The problem is :

How to get out of this weird situation : fedora 36, but not able to get kernels fc36 and corresponding grub menu line ?

Out of curiosity have you tried to reinstall grub?
sudo dnf reinstall grub2-common grub2-efi

The kernel package is a meta package that pulls in all the dependencies and other parts of the kernel.
since you do not have the ‘kernel’ package installed the system does not know what to do, and that is probably the cause of failure to create the initramfs and vmlinuz entries in /boot.

I think the fix is to follow these steps.

  1. dnf remove kernel*fc36* --noautoremove which will remove all the kernel packages from the fc36 install and will not try to remove all the extra packages. On my system there are about 20 or so packages that would be removed which is not really an issue. If you note which dependencies are removed they are easy to reinstall.
  2. dnf install kernel-5.17.7-300-fc36 which should install all the needed kernel packages for fc36.
  3. When #2 completes then ls -l /boot should now show the initramfs and vmlinuz entries for the 5.17.7 kernel

For me, doing dnf remove kernel*fc36* --noautoremove produces a huge list of packages that would be removed (104 altogether, totalling 2.1G in size). I tried instead dnf remove kernel*5.17.7-300.fc36.x86_64 followed by dnf install kernel-5.17.7-300.fc36.x86_64 but that did not put the newly-installed kernel in /boot.

I do see files related to the F36 kernels in /boot/efi. Not sure if they’re supposed to be there or not.

Please Have a look at, 2071034 – Installing kernel 5.17 doesn't copy relevant files to /boot/

Thanks.

1 Like

If you have a directory /boot/efi/xxxxxxxxxx (the xxxxxxxxx would be your machine ID) that contains the kernel files then remove that directory with rm -rf /boot/efi/xxxxxxxxxx then reinstall the kernel and it should properly place it in /boot. I have seen a few posts about this issue and the bug listed above shows it well.

Thanks, removing /boot/efi/<machine id> fixed the problem for me as well.

I still have the problem that attempting to remove the older kernel 5.17.6 triggers a mass removal of packages. It looks like that might be due to not having the kernel-headers package for 5.17.7 installed, but that package seems to be missing from the repos at the moment. I’ll open a new topic for that problem if I can’t fix it on my own.

1 Like

As reference: F36 kernel won't install due to running out of space in /boot/efi

(same issue)

Good catch !
I felt under this bug… which is not closed so far. I guess next time the kernel will upgrade, I will have same troubles (and same workaround ?).

Anyhow, thanks a lot for pointing to the right bug.
Regards
Alain

IIUC once this directory is removed the updates work normally. Some systems have been hit with this bug and others avoid it totally. I have a laptop that was upgraded from35 → 36 and a desktop that was upgraded from 34 → 36 and had no problem with either. Some small number of others have seen that problem, thus no fix for the bug as yet.