3

I need to keep an old kernel in Fedora: kernel-4.14.18-300.fc27.x86_64
But I still want the latest kernel updates.

1) A naive approach is to change the installonly_limit=3 value to a high number in /etc/dnf/dnf.conf.

2) A better solution was to use yumdb to avoid automatic removing of the specific kernel:

yumdb set installonly keep kernel-4.14.18-300.fc27.x86_64

But the yum package manager has been replaced with dnf and there is no dnfdb command...
I have tried adding the following line to /etc/dnf/dnf.conf with no luck:

installonlypkgs=kernel-4.14.18-300.fc27.x86_64`

How to keep a specific version of an old kernel while still allowing updates?

remjg
  • 141

2 Answers2

4

I think dnf mark is the command you are looking for. It marks the package as "user installed" protecting it from autoremoval.

dnf mark install kernel-4.14.18-300.fc27.x86_64

https://dnf.readthedocs.io/en/latest/command_ref.html#mark-command-label

There is also a dnf protect.d directory where you can store packages that shouldn't be removed. /etc/dnf/protected.d. However I have seen some people report this doesn't work with specific versions.

1

Edit : no kernel updates since the versionlock has been applied... Still looking for a solution !

I have found the versionlock dnf plugin which seems to eventually answer my problem:

sudo dnf install python3-dnf-plugins-extras-versionlock

According to here and there, the following commands should do the job in my case:

sudo dnf versionlock add kernel-4.14.18-300.fc27*
sudo dnf versionlock add kernel-core-4.14.18-300.fc27*
sudo dnf versionlock add kernel-modules-4.14.18-300.fc27*
sudo dnf versionlock add kernel-modules-extra-4.14.18-300.fc27*
sudo dnf versionlock add kernel-devel-4.14.18-300.fc27*
remjg
  • 141