DKMS 3.1.7
Dynamic Kernel Module Support, which stores out-of-tree module source and rebuilds it automatically for every kernel you install, keeping NVIDIA, VirtualBox, and ZFS working across updates.
Download TAR.GZ Project website ↗Download Mirrors
Most drivers are in the kernel and are built with it. A few are not, for licensing reasons or because a vendor maintains them separately, and those must be compiled against every kernel you install. DKMS does that automatically.
The command that prevents disasters
dkms status
# nvidia/560.35.03, 6.18.44, x86_64: installed
# zfs/2.4.4, 6.18.44, x86_64: installed
Run this after a kernel update and before rebooting. If the new kernel is not listed alongside a module, that module will not be there when you reboot.
Fixing it now takes a minute. Fixing it after booting into a system with no graphics driver takes considerably longer, and this single habit is the most valuable thing to know about DKMS.
Why builds fail
Missing kernel headers, by a wide margin the most common:
sudo apt install linux-headers-generic # tracks your kernel series
sudo dnf install kernel-devel
sudo pacman -S linux-headers
You need headers for the new kernel, not the running one, which is why installing the metapackage that tracks your series is the reliable arrangement.
Module source too old for the kernel. Kernel internals change and a module written against 6.12 may not compile against 7.2. The fix is a newer module, which is why OpenZFS publishes a supported kernel range.
A full /boot, which produces a truncated initramfs and is worse than a failed build.
Repairing
sudo dkms autoinstall
cat /var/lib/dkms/nvidia/560.35.03/build/make.log # the actual error
sudo dkms install -m nvidia -v 560.35.03 -k 6.18.44
The make.log is where the compiler error lives and is far more informative than the summary.
If you have already rebooted into a broken system, boot the previous kernel from the GRUB menu and repair from there.
Secure Boot
A module can build perfectly and still refuse to load:
mokutil --sb-state
sudo dmesg | grep -i 'module verification'
Enrol a machine owner key and configure DKMS to sign, or disable Secure Boot.
Reducing exposure
Every out-of-tree module is something that can break on a kernel update. Prefer in-tree alternatives where they are adequate: the open NVIDIA kernel modules on supported hardware, or Btrfs over ZFS when snapshots are all you need.
Our DKMS guide covers the whole picture.
Verify Your Download
Source releases are on GitHub. Every distribution packages it.