Downgrading to a previous kernel version

Probably a slightly different take to an often asked question.

So, I did a fresh Fedora 33 install. It installed kernel-5.13.6. Have a need to downgrade to 5.12.latest

Downloaded the rpm kernel-5.12.18-200.fc33.x86_64.rpm from Koji repo and attempted a local install.

Is there a way to tell it to pull all the dependencies it needs?

 sudo dnf install ./kernel-5.12.18-200.fc33.x86_64.rpm
...
Error:
 Problem: conflicting requests
  - nothing provides kernel-core-uname-r = 5.12.18-200.fc33.x86_64 needed by kernel-5.12.18-200.fc33.x86_64
  - nothing provides kernel-modules-uname-r = 5.12.18-200.fc33.x86_64 needed by kernel-5.12.18-200.fc33.x86_64

Update - so here’s how it went

I followed the Fedora Magazine article link by @augenauf (including the comment 2, from Paul W Frields )

  • install the koji package
[jetstream@viglen ~]$ sudo dnf install koji

Installed:
  koji-1.25.1-1.fc33.noarch         python3-gssapi-1.6.9-2.fc33.x86_64
  python3-koji-1.25.1-1.fc33.noarch python3-requests-gssapi-1.2.2-1.fc33.noarch
  • Download the rpm (including dependencies)

This command resolves all dependencies and downloads the relevant packages needed.

[jetstream@viglen ~]$ koji download-build --arch=x86_64 kernel-5.12.18-200.fc33
Downloading: kernel-5.12.18-200.fc33.x86_64.rpm
Downloading: kernel-modules-internal-5.12.18-200.fc33.x86_64.rpm
Downloading: kernel-debug-modules-internal-5.12.18-200.fc33.x86_64.rpm
Downloading: kernel-modules-extra-5.12.18-200.fc33.x86_64.rpm
Downloading: kernel-debug-5.12.18-200.fc33.x86_64.rpm
Downloading: kernel-debug-modules-extra-5.12.18-200.fc33.x86_64.rpm
Downloading: kernel-modules-5.12.18-200.fc33.x86_64.rpm
Downloading: kernel-debug-modules-5.12.18-200.fc33.x86_64.rpm
Downloading: kernel-debug-core-5.12.18-200.fc33.x86_64.rpm
Downloading: kernel-core-5.12.18-200.fc33.x86_64.rpm
Downloading: kernel-debug-devel-5.12.18-200.fc33.x86_64.rpm
Downloading: kernel-devel-5.12.18-200.fc33.x86_64.rpm
  • run dnf install with the packages
[jetstream@viglen ~]$ sudo dnf install ./kernel-5.12.18-200.fc33.x86_64.rpm ./kernel-core-5.12.18-200.fc33.x86_64.rpm ./kernel-debug-5.12.18-200.fc33.x86_64.rpm ./kernel-debug-core-5.12.18-200.fc33.x86_64.rpm ./kernel-debug-devel-5.12.18-200.fc33.x86_64.rpm ./kernel-debug-modules-5.12.18-200.fc33.x86_64.rpm ./kernel-debug-modules-extra-5.12.18-200.fc33.x86_64.rpm ./kernel-debug-modules-internal-5.12.18-200.fc33.x86_64.rpm ./kernel-devel-5.12.18-200.fc33.x86_64.rpm ./kernel-modules-5.12.18-200.fc33.x86_64.rpm ./kernel-modules-extra-5.12.18-200.fc33.x86_64.rpm ./kernel-modules-internal-5.12.18-200.fc33.x86_64.rpm

...

Installed:
  kernel-5.12.18-200.fc33.x86_64                                kernel-core-5.12.18-200.fc33.x86_64                              kernel-debug-5.12.18-200.fc3
  kernel-debug-core-5.12.18-200.fc33.x86_64                     kernel-debug-devel-5.12.18-200.fc33.x86_64                       kernel-debug-modules-5.12.18
  kernel-debug-modules-extra-5.12.18-200.fc33.x86_64            kernel-debug-modules-internal-5.12.18-200.fc33.x86_64            kernel-devel-5.12.18-200.fc3
  kernel-modules-5.12.18-200.fc33.x86_64                        kernel-modules-extra-5.12.18-200.fc33.x86_64                     kernel-modules-internal-5.12

...

Complete!
  • Set the default boot option - so it boots this kernel version always
[jetstream@viglen ~]$ sudo grubby --set-default /boot/vmlinuz-5.12.18-200.fc33.x86_64

The default is /boot/loader/entries/d8d6c4dea0644468b847634bd300f021-5.12.18-200.fc33.x86_64.conf with index 2 and kernel /boot/vmlinuz-5.12.18-200.fc33.x86_64
  • Add a versionlock - so this version is not deleted when kernel updates are installed
[jetstream@viglenf31 ~]$ sudo dnf versionlock add kernel-5.12.18-200.fc33
Adding versionlock on: kernel-0:5.12.18-200.fc33.*
  • Optional - depending on how desperately this is needed. Many might frown upon this extreme step.

Set dnf to exclude the kernel package in its updates

4 Likes

We normally need three package for the same kernel version:

kernel-*
kernel-core-*
kernel-modules-*

Please download all three of them and install all three of them in one go.

2 Likes

Here is an article about installing kernels from koji

Have a look at @pfrields comment (#2) and find a single command there that downloads you every package you need to install a kernel from koji.

2 Likes

This should be a quick quick-doc if someone wants to write one up? I’ll open a topic in the #community:contributing-to-fedora

2 Likes

Happy to do it. Am going to post the info here for review as I am working through it.

Then I need some guidance on the process to follow on submitting it for quick-doc.

4 Likes

That’s great!

We can discuss conversion to the quick-doc here (so that the two topics, one about the solution, and one about the conversion to quick-docs, remain separate):

https://discussion.fedoraproject.org/t/would-someone-like-to-convert-the-how-to-install-a-kernel-from-koji-fedora-magazine-post-to-a-quick-doc/76101

1 Like

Thanks @sampsonf and @augenauf - you’re both correct. Marking @augenauf’s suggestion as the solution just because it involves less manual steps.

I have updated the original post to include the steps I went through.

1 Like

Here’s a one-liner that downloads RPMs to unique temporary directory and installs them:
cd $(mktemp -d) && koji download-build --arch=x86_64 --arch=noarch kernel-5.13.8-200.fc34 && dnf upgrade *
No need to clean up after installation, no risk of installing some other RMPs from Downloads.

If you need more than one package (e.g. KDE updates bundle lots of packages in one update), copy list of builds from sidebar of bodhi update page and paste them inside quotation marks:
cd $(mktemp -d) && echo -e "PASTE_HERE" | xargs -tI % sh -c 'koji download-build --arch=x86_64 --arch=noarch %' && dnf upgrade *

3 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.