Kernel and kernel-devel and kernel-headers do not fit together

I urgently need to build a dkms package in dom0. However I always get the error that the kernel-headers cannot be found at /lib/modules/5.4.98-1.fc25.qubes.x86_64/build or /lib/modules/5.4.98-1.fc25.qubes.x86_64/source.

dnf list installed kernel-devel kernel-headers kernel
kernel.x86_64 1000:5.4.98-1.fc25.qubes @anaconda
kernel-devel.x86_64 1000:5.4.125-1.fc25.qubes @qubes-dom0-cached
kernel-headers.x86_64 4.13.16-100.fc25 qubes-dom0-chached

I think here is the error. The kernel and the kernel-devel package do not fit together. However, uninstalling and reinstalling does not help.
Has anyone a solution? Is it a bug?

Installing nvidia driver is huge headache sometimes, i’ve try install with different kernel-dkms in the past it succeeded with some tweaks, but it’s not worthed in qubes. i’d rather go with windows in different storage.

Sorry can’t help, you can dig in google.

I don’t want to install nvidia drivers :wink:

I’ve fixed my issues by:

sudo qubes-dom0-update kernel

Then installed it via Yum-Extender Gui

Then according to “dnf list installed kernel” I had the old and new one still installed. I did:

sudo qubes-dom0-update kernel-qubes-vm --best --allowerasing

which is most likely not necessary since it is for the VMs not dom0.

sudo dnf remove kernel 5.4.98

However, I am not sure that it was the technically correct way. See also How to Update | Qubes OS.
If it was incorrect what I did, please comment on this post. You can never stop learning.

Ah my bad didn’t ask, if you want to list installed kernel, you can check by :

rpm -qa kernel\* | sort -V

then run :

dnf remove kernel....