Bug 2221308

Summary: DNF does not want to downgrade kernel
Product: [Fedora] Fedora Reporter: Vít Ondruch <vondruch>
Component: dnf5Assignee: Marek Blaha <mblaha>
Status: ASSIGNED --- QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 39CC: jkolarik, mblaha, nsella, omosnacek, pkratoch, rpm-software-management
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vít Ondruch 2023-07-07 21:06:43 UTC
I have following kernel installed:

~~~
$ rpm -qa kernel*
kernel-modules-core-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64
kernel-core-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64
kernel-modules-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64
kernel-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64
~~~

and I suspect it has some issues with networking, therefore I'd like to install older version, but it does not look to be possible. The most obvious way does not work:

~~~
$ sudo dnf downgrade --enablerepo=updates{,-testing} kernel\* --releasever 38 
Updating and loading repositories:
Repositories loaded.
Package                 Arch   Version                 Repository           Size
Installing:                                                                     
 kernel                 x86_64 6.3.12-200.fc38         updates-testing   0.0   B
 kernel-core            x86_64 6.3.12-200.fc38         updates-testing  64.6 MiB
 kernel-modules         x86_64 6.3.12-200.fc38         updates-testing  53.7 MiB
 kernel-modules-core    x86_64 6.3.12-200.fc38         updates-testing  29.4 MiB

Transaction Summary:
 Installing:        4 packages

Total size of inbound packages is 102 MiB. Need to download 0 B.
After this operation 148 MiB will be used (install 148 MiB, remove 0 B).
Is this ok [y/N]: y
[1/4] kernel-0:6.3.12-200.fc38.x86_64   100% |   0.0   B/s |   0.0   B |  00m00s
>>> Already downloaded
[2/4] kernel-core-0:6.3.12-200.fc38.x86 100% |   0.0   B/s |   0.0   B |  00m00s
>>> Already downloaded
[3/4] kernel-modules-0:6.3.12-200.fc38. 100% |   0.0   B/s |   0.0   B |  00m00s
>>> Already downloaded
[4/4] kernel-modules-core-0:6.3.12-200. 100% |   0.0   B/s |   0.0   B |  00m00s
>>> Already downloaded
--------------------------------------------------------------------------------
[4/4] Total                             100% |   0.0   B/s |   0.0   B |  00m00s
Running transaction

Transaction failed: Rpm transaction failed.
  - package kernel-modules-core-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64 (which is newer than kernel-modules-core-6.3.12-200.fc38.x86_64) is already installed
  - package kernel-core-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64 (which is newer than kernel-core-6.3.12-200.fc38.x86_64) is already installed
  - package kernel-modules-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64 (which is newer than kernel-modules-6.3.12-200.fc38.x86_64) is already installed
  - package kernel-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64 (which is newer than kernel-6.3.12-200.fc38.x86_64) is already installed
~~~

Neither being more explicit:


~~~
 sudo dnf downgrade https://kojipkgs.fedoraproject.org//packages/kernel/6.3.12/200.fc38/x86_64/kernel-6.3.12-200.fc38.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/kernel/6.3.12/200.fc38/x86_64/kernel-core-6.3.12-200.fc38.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/kernel/6.3.1[vondruch@fedora ~]$ sudo dnf downgrade https://kojipkgs.fedoraproject.org//packages/kernel/6.3.12/200.fc38/x86_64/kernel-6.3.12-200.fc38.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/kernel/6.3.12/200.fc38/x86_64/kernel-core-6.3.12-200.fc38.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/kernel/6.3.12/200.fc38/x86_64/kernel-modules-6.3.12-200.fc38.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/kernel/6.3.12/200.fc38/x86_64/kernel-modules-core-6.3.12-200.fc38.x86_64.rpm
Updating and loading repositories:
Repositories loaded.
 https://kojipkgs.fedoraproject.org//pa 100% | 168.8 KiB/s | 132.8 KiB |  00m01s
 https://kojipkgs.fedoraproject.org//pa 100% |   4.0 MiB/s |  15.7 MiB |  00m04s
 https://kojipkgs.fedoraproject.org//pa 100% |   9.3 MiB/s |  54.9 MiB |  00m06s
 https://kojipkgs.fedoraproject.org//pa 100% |   4.2 MiB/s |  30.2 MiB |  00m07s
Package                 Arch   Version                  Repository          Size
Installing:                                                                     
 kernel                 x86_64 6.3.12-200.fc38          @commandline     0.0   B
 kernel-core            x86_64 6.3.12-200.fc38          @commandline    64.6 MiB
 kernel-modules         x86_64 6.3.12-200.fc38          @commandline    53.7 MiB
 kernel-modules-core    x86_64 6.3.12-200.fc38          @commandline    29.4 MiB

Transaction Summary:
 Installing:        4 packages

Total size of inbound packages is 101 MiB. Need to download 0 B.
After this operation 148 MiB will be used (install 148 MiB, remove 0 B).
Is this ok [y/N]: y

Running transaction

Transaction failed: Rpm transaction failed.
  - package kernel-modules-core-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64 (which is newer than kernel-modules-core-6.3.12-200.fc38.x86_64) is already installed
  - package kernel-core-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64 (which is newer than kernel-core-6.3.12-200.fc38.x86_64) is already installed
  - package kernel-modules-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64 (which is newer than kernel-modules-6.3.12-200.fc38.x86_64) is already installed
  - package kernel-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64 (which is newer than kernel-6.3.12-200.fc38.x86_64) is already installed
~~~

And install does not work as well:


~~~
$ sudo dnf install https://kojipkgs.fedoraproject.org//packages/kernel/6.3.12/200.fc38/x86_64/kernel-6.3.12-200.fc38.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/kernel/6.3.12/200.fc38/x86_64/kernel-core-6.3.12-200.fc38.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/kernel/6.3.12/200.fc38/x86_64/kernel-modules-6.3.12-200.fc38.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/kernel/6.3.12/200.fc38/x86_64/kernel-modules-core-6.3.12-200.fc38.x86_64.rpm
Updating and loading repositories:
Repositories loaded.
 https://kojipkgs.fedoraproject.org//pa 100% | 178.3 KiB/s | 132.8 KiB |  00m01s
 https://kojipkgs.fedoraproject.org//pa 100% |   4.9 MiB/s |  15.7 MiB |  00m03s
 https://kojipkgs.fedoraproject.org//pa 100% |   6.4 MiB/s |  30.2 MiB |  00m05s
 https://kojipkgs.fedoraproject.org//pa 100% |   5.9 MiB/s |  54.9 MiB |  00m09s
Package                 Arch   Version                  Repository          Size
Installing:                                                                     
 kernel                 x86_64 6.3.12-200.fc38          @commandline     0.0   B
 kernel-core            x86_64 6.3.12-200.fc38          @commandline    64.6 MiB
 kernel-modules         x86_64 6.3.12-200.fc38          @commandline    53.7 MiB
 kernel-modules-core    x86_64 6.3.12-200.fc38          @commandline    29.4 MiB

Transaction Summary:
 Installing:        4 packages

Total size of inbound packages is 101 MiB. Need to download 0 B.
After this operation 148 MiB will be used (install 148 MiB, remove 0 B).
Is this ok [y/N]: y

Running transaction

Transaction failed: Rpm transaction failed.
  - package kernel-modules-core-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64 (which is newer than kernel-modules-core-6.3.12-200.fc38.x86_64) is already installed
  - package kernel-core-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64 (which is newer than kernel-core-6.3.12-200.fc38.x86_64) is already installed
  - package kernel-modules-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64 (which is newer than kernel-modules-6.3.12-200.fc38.x86_64) is already installed
  - package kernel-6.5.0-0.rc0.20230705gitd528014517f2.10.fc39.x86_64 (which is newer than kernel-6.3.12-200.fc38.x86_64) is already installed
~~~

Reproducible: Always

Actual Results:  
It seems it is not possible to install older kernel

Expected Results:  
Older kernel can be installed

Comment 1 Vít Ondruch 2023-07-08 19:44:29 UTC
I was able to workaround this by uninstalling all installed kernels:

~~~
$ sudo dnf remove kernel\* --setopt=protect_running_kernel=false
~~~

But this is less then desirable workaround.

Comment 2 Vít Ondruch 2023-07-14 09:03:57 UTC
This is the DNF version in question:

~~~
$ rpm -q dnf5
dnf5-5.0.15-3.fc39.x86_64
~~~

Comment 4 Fedora Release Engineering 2023-08-16 08:12:03 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.