Problem to install a F36 kernel

I recently updated from F35 to F36 and I have a problem during installation of a kernel:

$ sudo dnf install kernel
Last metadata expiration check: 2:23:00 ago on Wed 18 May 2022 08:48:37 AM CEST.
Dependencies resolved.
===============================================================================================
 Package                  Architecture     Version                     Repository         Size
===============================================================================================
Installing:
 kernel                   x86_64           5.17.7-300.fc36             updates           164 k
 kernel-core              x86_64           5.17.7-300.fc36             updates            46 M
Installing dependencies:
 kernel-modules           x86_64           5.17.7-300.fc36             updates            53 M

Transaction Summary
===============================================================================================
Install  3 Packages

Total download size: 100 M
Installed size: 141 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): kernel-5.17.7-300.fc36.x86_64.rpm                       1.0 MB/s | 164 kB     00:00    
(2/3): kernel-core-5.17.7-300.fc36.x86_64.rpm                  6.0 MB/s |  46 MB     00:07    
(3/3): kernel-modules-5.17.7-300.fc36.x86_64.rpm               5.2 MB/s |  53 MB     00:10    
-----------------------------------------------------------------------------------------------
Total                                                          9.7 MB/s | 100 MB     00:10     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                       1/1 
  Installing       : kernel-core-5.17.7-300.fc36.x86_64                                    1/3 
  Running scriptlet: kernel-core-5.17.7-300.fc36.x86_64                                    1/3 
  Installing       : kernel-modules-5.17.7-300.fc36.x86_64                                 2/3 
  Running scriptlet: kernel-modules-5.17.7-300.fc36.x86_64                                 2/3 
  Installing       : kernel-5.17.7-300.fc36.x86_64                                         3/3 
  Running scriptlet: kernel-core-5.17.7-300.fc36.x86_64                                    3/3 
dkms: running auto installation service for kernel 5.17.7-300.fc36.x86_64
 Done. 
kdump: kernel 5.17.7-300.fc36.x86_64 doesn't exist

  Running scriptlet: kernel-modules-5.17.7-300.fc36.x86_64                                 3/3 
  Running scriptlet: kernel-5.17.7-300.fc36.x86_64                                         3/3 
  Verifying        : kernel-5.17.7-300.fc36.x86_64                                         1/3 
  Verifying        : kernel-core-5.17.7-300.fc36.x86_64                                    2/3 
  Verifying        : kernel-modules-5.17.7-300.fc36.x86_64                                 3/3 

Installed:
  kernel-5.17.7-300.fc36.x86_64                   kernel-core-5.17.7-300.fc36.x86_64          
  kernel-modules-5.17.7-300.fc36.x86_64          

Complete!

Result is : there is no /boot/vmlinuz-5.17.7-300.fc36.x86_64 installed
Very strange.
A rpm -ih -vv command says:

D: skip       100755  1 (   0,   0)11800752 /boot/vmlinuz-5.17.7-300.fc36.x86_64

I performed latest dnf updates


In fact, I did have the problem during dnf system upgrade because the new F36 kernel was not activated.
I am running the dnf install kernel from existing

/boot/vmlinuz-5.17.6-200.fc35.x86_64

kernel.

i am stuck !
Thanks for your help.
Regards
Alain

Welcome to ask.:fedora:edora @avigne

Please take a look at #start-here if you not did already.

Could you please give us more info’s as :

inxi -Fzx in terminal and post the output as </> Preformatted text here.

1 Like

What do you suspect ?

$ inxi -Fxz
System:
  Kernel: 5.17.6-200.fc35.x86_64 arch: x86_64 bits: 64 compiler: gcc
    v: 2.37-17.fc35 Desktop: GNOME v: 42.0
    Distro: Fedora release 36 (Thirty Six)
Machine:
  Type: Desktop System: ASUS product: All Series v: N/A
    serial: <superuser required>
  Mobo: ASUSTeK model: Z97M-PLUS v: Rev X.0x serial: <superuser required>
    UEFI: American Megatrends v: 2903 date: 02/22/2016
CPU:
  Info: quad core model: Intel Core i7-4790 bits: 64 type: MT MCP
    arch: Haswell rev: 3 cache: L1: 256 KiB L2: 1024 KiB L3: 8 MiB
  Speed (MHz): avg: 3409 high: 3769 min/max: 800/4000 cores: 1: 2993
    2: 3333 3: 3599 4: 3615 5: 3703 6: 3769 7: 2665 8: 3602 bogomips: 57566
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3
Graphics:
  Device-1: NVIDIA GM206 [GeForce GTX 960] vendor: Gigabyte driver: nvidia
    v: 510.68.02 bus-ID: 01:00.0
  Display: wayland server: X.org v: 1.20.14 with: Xwayland v: 22.1.1
    compositor: gnome-shell driver: X: loaded: N/A failed: nvidia gpu: nvidia
    resolution: 1920x1200~60Hz
  OpenGL: renderer: NVIDIA GeForce GTX 960/PCIe/SSE2
    v: 4.6.0 NVIDIA 510.68.02 direct render: Yes
Audio:
  Device-1: Intel 9 Series Family HD Audio vendor: ASUSTeK driver: N/A
    bus-ID: 00:1b.0
  Device-2: NVIDIA GM206 High Definition Audio vendor: Gigabyte driver: N/A
    bus-ID: 01:00.1
  Sound Server-1: PulseAudio v: 15.0 running: no
  Sound Server-2: PipeWire v: 0.3.51 running: yes
Network:
  Device-1: Intel Ethernet I218-V vendor: ASUSTeK driver: e1000e v: kernel
    port: f040 bus-ID: 00:19.0
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: Realtek RTL8192CE PCIe Wireless Network Adapter vendor: ASUSTeK
    driver: N/A port: d000 bus-ID: 05:00.0
  IF-ID-1: virbr0 state: down mac: <filter>
Drives:
  Local Storage: total: 1.14 TiB used: 163.03 GiB (14.0%)
  ID-1: /dev/sda vendor: Samsung model: SSD 850 EVO 250GB size: 232.89 GiB
  ID-2: /dev/sdb vendor: Seagate model: ST1000DM003-1ER162 size: 931.51 GiB
Partition:
  ID-1: / size: 49.04 GiB used: 23.59 GiB (48.1%) fs: ext4 dev: /dev/dm-1
    mapped: fedora-root
  ID-2: /boot size: 1.41 GiB used: 204.1 MiB (14.2%) fs: ext4
    dev: /dev/sda2
  ID-3: /boot/efi size: 399.8 MiB used: 211.3 MiB (52.9%) fs: vfat
    dev: /dev/sda1
  ID-4: /home size: 164.2 GiB used: 139.04 GiB (84.7%) fs: ext4
    dev: /dev/dm-2 mapped: fedora-home
Swap:
  ID-1: swap-1 type: partition size: 14 GiB used: 0 KiB (0.0%) dev: /dev/dm-0
    mapped: fedora-swap
  ID-2: swap-2 type: zram size: 8 GiB used: 0 KiB (0.0%) dev: /dev/zram0

Same here. I downloaded the rpm and tried to extract the files with cpio to my home directory. The /boot directory is not extracted. However, other computers install this kernel with no issues.

EDIT: But even if the kernel is installed in these other computers, rpm2cpio does not extract the files.

Ahhhh.
I see you are running 35 from this
Kernel: 5.17.6-200.fc35.x86_64 arch
but are trying to install a kernel from 36

$ sudo dnf install kernel
Last metadata expiration check: 2:23:00 ago on Wed 18 May 2022 08:48:37 AM CEST.
Dependencies resolved.
===============================================================================================
 Package                  Architecture     Version                     Repository         Size
===============================================================================================
Installing:
 kernel                   x86_64           5.17.7-300.fc36             updates           164 k
 kernel-core              x86_64           5.17.7-300.fc36             updates            46 M

I wonder if you had an incomplete upgrade?

I would not use dnf install kernel but instead would use dnf upgrade kernel* so it handled all the parts of the kernel while updating the kernel to the latest.

No, it doesn’t work either

$ sudo dnf upgrade kernel*
Last metadata expiration check: 0:09:19 ago on Wed 18 May 2022 03:29:13 PM CEST.
Package kernel not installed, cannot update it.
No match for argument: kernel-5.17.7-300.fc36.x86_64.rpm
Package kernel-modules not installed, cannot update it.
No match for argument: kernel-modules-5.17.7-300.fc36.x86_64.rpm
Dependencies resolved.
===============================================================================================================================================================================================
 Package                                       Architecture                             Version                                           Repository                                      Size
===============================================================================================================================================================================================
Installing:
 kernel-core                                   x86_64                                   5.17.7-300.fc36                                   @commandline                                    46 M

Transaction Summary
===============================================================================================================================================================================================
Install  1 Package

Total size: 46 M
Installed size: 89 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                       1/1 
  Installing       : kernel-core-5.17.7-300.fc36.x86_64                                                                                                                                    1/1 
  Running scriptlet: kernel-core-5.17.7-300.fc36.x86_64                                                                                                                                    1/1 
dkms: running auto installation service for kernel 5.17.7-300.fc36.x86_64
 Done. 
kdump: kernel 5.17.7-300.fc36.x86_64 doesn't exist

  Verifying        : kernel-core-5.17.7-300.fc36.x86_64                                                                                                                                    1/1 

Installed:
  kernel-core-5.17.7-300.fc36.x86_64                                                                                                                                                           

Complete!

Remark the

kdump: kernel 5.17.7-300.fc36.x86_64 doesn't exist

and, as a verification

$ 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

No vmlinuz-5.17.7-300.fc36.x86_64 in /boot/ :frowning:

This dnf upgrade kernel* command is not pulling kernel and kernel modules ?

I still don’t understand. :question:

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.