Dkms — Why Some Linux Drivers Survive Every Kernel Update
A friendly look at Dynamic Kernel Module Support, the small system that quietly rebuilds out-of-tree Linux drivers every time the kernel updates.
A friendly look at Dynamic Kernel Module Support, the small system that quietly rebuilds out-of-tree Linux drivers every time the kernel updates.
Linux drivers compiled against one kernel version usually do not work on another, because the kernel's internal API is not stable across major versions. Without help, every kernel upgrade would break every out-of-tree driver on the system.
Dkms — Dynamic Kernel Module Support — solves this by keeping the source code of out-of-tree drivers around and rebuilding them automatically each time the kernel updates. The result is that the user almost never notices the kernel changing under their feet.
When you install an out-of-tree driver — say, a proprietary graphics driver via your distribution's package manager, or a Wi-Fi driver from a vendor's website — the package places its source under /usr/src and registers it with Dkms.
Each time apt, dnf, or pacman installs a new kernel, Dkms rebuilds every registered driver against the new kernel and installs the resulting modules. Boot into the new kernel and your hardware just works, with no extra steps from you.
Occasionally a kernel update introduces a change that breaks a particular out-of-tree driver. Dkms reports the build failure, the user boots into the new kernel without that driver, and the affected hardware stops working until the vendor publishes a patched source.
This is the small price for using out-of-tree drivers. Drivers that are upstream in the kernel tree do not need Dkms at all — the kernel maintainers update them in lockstep with the rest of the code.
The questions readers send us most often on this topic.
No — only for out-of-tree drivers. Drivers shipped with the kernel itself update along with the kernel automatically.
The system boots without that driver. You either pick a different kernel temporarily or wait for the vendor to publish updated source code.
Yes — Debian, Ubuntu, Fedora, openSUSE, and Arch all ship Dkms in their default repositories.
Hand-picked articles that pair well with this one.
We translate the technical so you can focus on using your computer rather than fighting it.