Dnf versionlock kernel include modules?

I’d like to lock my kernel for a little bit using versionlock, but I am still a bit confused how to do so.

in this topic the idea is to simply run

sudo dnf versionlock add kernel-5.12.18-200.fc33

But here a different author mentioned that it’s necessary to lock


as well. Can anybody tell me which one is correct and whether this is documented somewhere? Think that would be quite useful to mention somewhere in the docs.

The kernel package is a “metapackage”, so it doesn’t actually include any files:

$ rpm -ql kernel-5.16.5-200.fc35.x86_64
(contains no files)

It pulls in the kernel-core and kernel-modules sub-packages. So you can only go sudo dnf install kernel and everything gets installed. You can see this in the requires of the kernel package:

$ rpm -q --requires kernel-5.16.5-200.fc35.x86_64
kernel-core-uname-r = 5.16.5-200.fc35.x86_64
kernel-modules-uname-r = 5.16.5-200.fc35.x86_64
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1

I think it should be sufficient to lock only the kernel package, because while that is locked, dnf will not want to remove its dependencies either (the kernel-core and kernel-modules) packages, but I haven’t locked the kernel in ages so I cannot tell for sure.

The kernel-modules-extra package is an extra (optional) package, and as we see, it is not required by the kernel. So I expect that will need to be locked separately.

1 Like