Cannot update kernel on a recently upgraded F36

I recently upgraded to f36 from 35. I tried to update the kernel but I had two kernels from f35 still installed which apparently caused conflicts and the update fails. I followed the post-upgrade cleanup steps and the script from the
official docs but the scipt outputs Error: Problem: The operation would result in removing the following protected packages: kernel-core Failed to remove old kernels

  • $uname -a: Linux localhost 5.17.9-300.fc36.x86_64 #1 SMP PREEMPT Wed May 18 15:08:23 UTC 2022 x86_64 x86_6 4 x86_64 GNU/Linux
  • Output of #dnf update kernel:Error: Problem: package kernel-modules-extra-5.17.11-300.fc36.x86_64 requires kernel-uname-r = 5.17.11-300.fc36.x86_64, but none of the providers can be installed \- conflicting requests (try to add '--skip-broken' to skip uninstallable packages)
  • I managed to remove the old kernels by #yum remove <kernel name> but the issue persists.

Fedora keeps multiple kernels around. So right after an upgrade you will have a mix of kernels from F35 and F36. That is normal.

To be clear, are you saying that none of the kernels from F36 are getting installed?

Yes, I am unable to update.
currently installed kernels:
kernel-5.17.9-300.fc36.x86_64
kernel-5.17.11-300.fc36.x86_64. (earlier I had two extras from f35)

Post here output of:

dnf versionlock list
dnf list installed kernel*
dnf distrosync -v --refresh

Use Ctrl+e to format it in your replay.

[root@localhost ~]# dnf versionlock list
Last metadata expiration check: 1:09:30 ago on Sunday 14 August 2022 08:41:57 PM.
[root@localhost ~]# dnf list installed kernel*
Installed Packages
kernel.x86_64                                    5.17.9-300.fc36                       @updates
kernel.x86_64                                    5.17.11-300.fc36                      @updates
kernel-core.x86_64                               5.17.6-200.fc35                       @@System
kernel-core.x86_64                               5.17.9-200.fc35                       @updates
kernel-core.x86_64                               5.17.9-300.fc36                       @updates
kernel-core.x86_64                               5.17.11-300.fc36                      @updates
kernel-devel.x86_64                              5.17.6-200.fc35                       @@System
kernel-devel.x86_64                              5.17.9-200.fc35                       @updates
kernel-devel.x86_64                              5.17.9-300.fc36                       @updates
kernel-devel.x86_64                              5.17.11-300.fc36                      @updates
kernel-devel-matched.x86_64                      5.17.9-300.fc36                       @updates
kernel-devel-matched.x86_64                      5.17.11-300.fc36                      @updates
kernel-headers.x86_64                            5.17.6-300.fc36                       @updates
kernel-headers.x86_64                            5.17.11-300.fc36                      @updates
kernel-modules.x86_64                            5.17.6-200.fc35                       @@System
kernel-modules.x86_64                            5.17.9-200.fc35                       @updates
kernel-modules.x86_64                            5.17.9-300.fc36                       @updates
kernel-modules.x86_64                            5.17.11-300.fc36                      @updates
kernel-modules-extra.x86_64                      5.17.6-200.fc35                       @@System
kernel-modules-extra.x86_64                      5.17.9-200.fc35                       @updates
kernel-modules-extra.x86_64                      5.17.9-300.fc36                       @updates
kernel-modules-extra.x86_64                      5.17.11-300.fc36                      @updates
kernel-srpm-macros.noarch                        1.0-14.fc36                           @fedora 
[root@localhost ~]# dnf distrosync -v --refresh
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, needs-restarting, playground, repoclosure, repodiff,repograph, repomanage, reposync, system-upgrade, versionlock
DNF version: 4.13.0
cachedir: /var/cache/dnf
User-Agent: constructed: 'libdnf (Fedora Linux 36; kde; Linux.x86_64)'
Copr repo for PyCharm owned by phracek                         1.0 kB/s | 3.6 kB     00:03    
reviving: 'phracek-PyCharm' can be revived - repomd matches.
phracek-PyCharm: using metadata from Wednesday 27 July 2022 10:01:44 AM.
countme: no event for fedora: window already counted
Fedora 36 - x86_64                                             3.2 kB/s | 4.8 kB     00:01    
reviving: 'fedora' can be revived - metalink checksums match.
fedora: using metadata from Thursday 05 May 2022 02:46:11 AM.
Fedora 36 - Source                                             4.0 kB/s | 4.9 kB     00:01    
reviving: 'fedora-source' can be revived - metalink checksums match.
fedora-source: using metadata from Thursday 05 May 2022 02:44:11 AM.
Fedora 36 openh264 (From Cisco) - x86_64                       356  B/s | 989  B     00:02    
reviving: 'fedora-cisco-openh264' can be revived - metalink checksums match.
fedora-cisco-openh264: using metadata from Thursday 07 April 2022 10:22:38 PM.
countme: no event for fedora-modular: window already counted
Fedora Modular 36 - x86_64                                     4.2 kB/s | 4.8 kB     00:01    
reviving: 'fedora-modular' can be revived - metalink checksums match.
fedora-modular: using metadata from Thursday 05 May 2022 02:42:01 AM.
countme: no event for updates: window already counted
Fedora 36 - x86_64 - Updates                                   7.5 kB/s |  16 kB     00:02    
reviving: 'updates' can be revived - metalink checksums match.
updates: using metadata from Sunday 14 August 2022 07:59:02 AM.
countme: no event for updates-modular: window already counted
Fedora Modular 36 - x86_64 - Updates                           3.2 kB/s | 4.3 kB     00:01    
reviving: 'updates-modular' can be revived - metalink checksums match.
updates-modular: using metadata from Friday 12 August 2022 07:26:42 AM.
RPM Fusion for Fedora 36 - Free                                742  B/s | 2.0 kB     00:02
reviving: 'rpmfusion-free' can be revived - metalink checksums match.
rpmfusion-free: using metadata from Wednesday 04 May 2022 10:18:11 AM.
RPM Fusion for Fedora 36 - Free - Updates                      5.9 kB/s |  11 kB     00:01
reviving: 'rpmfusion-free-updates' can be revived - metalink checksums match.
rpmfusion-free-updates: using metadata from Thursday 11 August 2022 10:02:44 PM.
RPM Fusion for Fedora 36 - Nonfree - NVIDIA Driver             6.7 kB/s |  11 kB     00:01
reviving: 'rpmfusion-nonfree-nvidia-driver' can be revived - metalink checksums match.
rpmfusion-nonfree-nvidia-driver: using metadata from Thursday 11 August 2022 10:56:04 PM.
RPM Fusion for Fedora 36 - Nonfree - Steam                     7.2 kB/s |  11 kB     00:01
reviving: 'rpmfusion-nonfree-steam' can be revived - metalink checksums match.
rpmfusion-nonfree-steam: using metadata from Thursday 11 August 2022 10:56:14 PM.
--> Starting dependency resolution
--> Finished dependency resolution
Error:
Problem: The operation would result in removing the following protected packages: dnf
(try to add '--skip-broken' to skip uninstallable packages)
[root@localhost ~]#

kernel is a meta-package that triggers the install of kernel-core,kernel-modules.

[rj@rawhide ~]$ dnf repoquery -l kernel
Package kernel-5.16.20-200.fc35.x86_64 contains no files
Package kernel-5.17.8-300.fc36.x86_64 contains no files
Package kernel-5.18.10-200.fc36.x86_64 contains no files
Package kernel-5.18.11-200.fc36.x86_64 contains no files
Package kernel-5.18.13-200.fc36.x86_64 contains no files
Package kernel-5.18.16-200.fc36.x86_64 contains no files
Package kernel-5.18.9-200.fc36.x86_64 contains no files

Removing kernel doesn’t trigger the removal of kernel-core, kernel-modules, kernel-modules-extra, kernel-devel, kernel-devel-matched.
The user has to manually remove at the minimum kernel-core which will autoremove kernel and kernel-modules due to it’s dependency.

Removing only kernel Freed space: 0

[rj@rawhide ~]$ sudo dnf remove kernel-5.17.8-300.fc36
Dependencies resolved.
================================================================================
 Package       Architecture  Version                   Repository          Size
================================================================================
Removing:
 kernel        x86_64        5.17.8-300.fc36           @_dnf_local          0  

Transaction Summary
================================================================================
Remove  1 Package

Freed space: 0  
Is this ok [y/N]:         
Operation aborted.

Removing kernel-core autoremoves kernel and kernel-modules Freed space: 141 M

[rj@rawhide ~]$ sudo dnf remove kernel-core-5.17.8-300.fc36
Dependencies resolved.
================================================================================
 Package             Arch        Version                 Repository        Size
================================================================================
Removing:
 kernel-core         x86_64      5.17.8-300.fc36         @_dnf_local       89 M
Removing dependent packages:
 kernel              x86_64      5.17.8-300.fc36         @_dnf_local        0  
 kernel-modules      x86_64      5.17.8-300.fc36         @_dnf_local       52 M

Transaction Summary
================================================================================
Remove  3 Packages

Freed space: 141 M
Is this ok [y/N]: 

All other kernel packages such as devel, modules-extra have to be manually removed to save space but they wouldn’t block installing a new kernel.

Something must have not upgraded properly. Now do and post output of:

dnf remove kernel-*-200.fc35 -v
dnf distro-sync -v --skip-broken

If the above doesn’t work, run this, but do not confirm this operation until someone here says it’s safe to do:

dnf distro-sync -v --skip-broken --allowerasing
2 Likes

dnf remove kernel-*-200.fc35 -v

Thank you. Manually removing the older kernel-core & kernel module packages solved the issue.

You’re welcome, dnf distro-sync should make sure there are no more remnants.