I seem to have allowed a kernel upgrade, which is fine in itself.
However it stopped my displaylink screens from working.
During trying to fix that I found the headers for this new kernel don’t seem to be available…..
Am I doing the wrong thing? Should this fix itself if I wait? Any suggestions?
sudo dnf install linux-headers-$( uname -r )
Last metadata expiration check: 0:15:11 ago on Thu 11 Dec 2025 11:53:43 GMT.
No match for argument: linux-headers-5.14.0-611.11.1.el9_7.x86_64
Error: Unable to find a match: linux-headers-5.14.0-611.11.1.el9_7.x86_64
It depends which kernel you are booted into. If you are booted in a 9.6 kernel, then it won’t find the kernel-headers for that kernel, because the one that exists in the repos is for 9.7. Also, linux-headers is a package name from Debian/Ubuntu, so it won’t work anyway for EL-based distros.
In RHEL, the command would work, since kernel-headers for all kernels are available. So if we did:
dnf install kernel-headers-`uname -r`
that would work on RHEL when booted in an older kernel. But that is not possible for Rocky, since only the latest release is supported.
Not sure I followed, as I am booted into 9.7 with kernel 5.14.0-611.11.1.el9_7.x86_64 and if I read you right that name for the desired headers SHOULD match?
But it doesn’t
$sudo dnf install linux-headers-$( uname -r )
…
No match for argument: linux-headers-5.14.0-611.11.1.el9_7.x86_64
Error: Unable to find a match: linux-headers-5.14.0-611.11.1.el9_7.x86_64
———–
$sudo dnf install kernel-headers
…
Package kernel-headers-5.14.0-611.11.1.el9_7.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
—————
However:
$sudo dnf list installed | grep kernel-header
kernel-headers.x86_64 5.14.0-611.11.1.el9_7 @appstream
Note that I do have kernel-headers, but they are not in the “install-only” list?
That is, I can have multiple versions of kernel, kernel-core, kernel-devel, kernel-modules, and kernel-modules-core simultaneously installed, but only one kernel-headers. The files of kernel-headers are in /usr/include with no version number.
You do plain dnf install kernel-headers and its files are used for compilation of modules for every kernel version. I don’t know whether the el9_7 headers are appropriate for el9_6 kernels.
As already said, it’s not going to work because linux-headers is a Debian/Ubuntu package. The equivalent in EL world is kernel-headers. Had you used my example from my previous post, eg:
you would see I wrote kernel-headers and not linux-headers. But again, as I also wrote, only the latest package of kernel-headers is available, so it would work when booted into the same kernel version as the kernel you are running. For RHEL as mentioned, there are multiple kernel-headers package, and so would work even when booted into older kernels.
Yeah, thanks. I’m beginning to see that once I have jump over to a new kernel version, I sort of have to stay jumped.
Which would be great if everything worked
But my displaylink monitors now don’t - see other thread - so I’m quietly frustrated. Or sometimes noisily.
A general comment about the kernel-headers package. It is only necessary if you intend to rebuild glibc and, thus, the entire operating system. When you see a message like “your kernel headers for kernel xxx cannot be found …”, you most likely need the kernel-devel package, not the kernel-headers package.
I understand kernel-devel is called linux-headers in Debian/Ubuntu.
Thanks. I think the need for headers was provoked by displaylink compiling it’s evdi graphics driver, which seems to need to know the layout of some system structs.
Structs which apparently changed with 611 causing it to fail to compile,which started my grief.