Dkms depends on kernel 6.9

I have some modules that can be built on kernel v6.8 but cannot be built on v6.9, and I want to install them using DKMS. I am using an old Fedora kernel v6.8. However, when I execute yum install dkms, DKMS installs the dependency kernel-core/kernel-devel for kernel v6.9, as shown in the picture below:

This creates a problem because when I want to install my kernel module into DKMS via the dkms postinstall command, DKMS tries to install the module into both the current kernel (6.8) and the newest kernel (6.9, which was installed as a dependency of DKMS). DKMS checks for the newest kernel with the following command:

rpm -q --qf="%{VERSION}-%{RELEASE}.%{ARCH}\n" --whatprovides kernel | tail -n 1

As a result, this causes a build failure.

My question is:

why does DKMS require a dependency on kernel v6.9 even though I am using kernel v6.8?

Is this a bug? (Is this dependency a mistake?)
If the dependency is necessary, why is it on kernel v6.9 when Fedora 40 is using kernel v6.8? Does DKMS always need the latest version to function properly?

I have already tried this on Fedora 39 with kernel v6.6, and yum install dkms did not require this dependency. I also tried installing dkms.rpm from here, but this RPM also has a dependency on kernel-devel v6.9.

I dont know about the state of yum (I read it is deprecated and only kept for legacy support), but on Fedora you normally use dnf, since Fedora 22!

Are you on F39 or F40?

At least on F40, 6.9 is supported, 6.8 not anymore, to my knowledge

Hi thanks you for reply

I am in Fedora 40

  1. install by dnf showed the same result
  2. I already add the additional describe of my concern

If the dependency is necessary, why is it on kernel v6.9 when Fedora 40 is using kernel v6.8? Does DKMS always need the latest version to function properly?

I think dkms should be works fine with the current kernel version i am using, not always newest kernel.

1 Like

Removed f39

Fedora doesnt use 6.8

We are on 6.9.x now

I suppose your broken DKMS module prevented the upgrade.

Why do you need it, can you remove it, do the upgrade and when needed add back in afterwards?

Thank you for your response. I know that the latest kernel version for Fedora 40 is 6.9.x, but I am currently testing some things on Fedora 40 with kernel 6.8, because the default kernel version from the DVD ISO installation is 6.8.5. (Fedora 40 : Download : Server World)

Ideally, when I install the DKMS package, its dependency should reference the kernel version I am currently using, not the latest available kernel version.

This is how it works in Fedora 39 as well. When I install DKMS on Fedora 39 with kernel v6.6.x, it doesn’t require me to install the latest v6.9.x kernel-devel, even though Fedora 39 currently supports kernel v6.9.x.

I need DKMS because my kernel module needs it for installation. However, if I remove the 6.9 kernel-devel, DKMS will also be removed.

1 Like

Does this help?

sudo dnf install dkms --disablerepo=u*g

I am sure you have very good reasons for that, and I am not sure why the anaconda ISO kernel is that one, likely it is a kind of stable, semi-backported one.

But I wouldnt take that as a reason to use it permanently though.

Sorry No help, also need install kernel-devel 6.9

I feel we shouldn’t dwell on which kernel version I am using, but rather discuss whether the DKMS dependency is reasonable and meets expectations.

dkms requires any kernel-devel and kernel-devel-matched. If you don’t yet have any kernel-devel packages installed in needs to install the one that is available from the repository plus the matching kernel-core and kernel-modules directories.

You can find earlier versions of the kernel packages at


As this is not an LTS kernel and Fedora (may?) only support the latest kernel, I think this is intended.

Unless it’s the everything/netinstall or a respin ISO the image contains the kernel version when it was released.

You could try looking at the dkms.conf for the module you’re building and try setting

1 Like

Thanks all

Here is the answer, after I tried to install kernel-devel-matched for my current using kernel version.

I can directly install dkms without any dependency

1 Like

The install media uses the kernel available at the time of a Fedora release and the install media is not rebuilt.

Yum is a symlink to dnf.


The repository fedora initial version of all packages at release time. This will be the same version as found in the Live system. All updates goes into the updates repository. If you install fedora-repos-archive you may find older update versions in the updates-archive repository. Enable that repository might slow down dnf operations, though.

1 Like

I see this which answers your comment.

# ls -l /usr/bin/{yum,dnf*}
lrwxrwxrwx. 1 root root    5 Mar 28 19:00 /usr/bin/dnf -> dnf-3
-rwxr-xr-x. 1 root root 2092 Mar 28 19:00 /usr/bin/dnf-3
lrwxrwxrwx. 1 root root    5 Mar 28 19:00 /usr/bin/dnf4 -> dnf-3
lrwxrwxrwx. 1 root root    5 Mar 28 19:00 /usr/bin/yum -> dnf-3