📖 ~1 min read
Table of contents
Symptom & Impact
Third-party modules fail to compile after kernel upgrade, breaking dependent services.
Environment & Reproduction
Seen with NVIDIA, VirtualBox, and out-of-tree modules during apt upgrades.
uname -r
dkms status
sudo apt -f install
Root Cause Analysis
Missing headers/toolchain or module source incompatibility with new kernel ABI.
Quick Triage
Inspect DKMS build logs for first compilation error.
sudo find /var/lib/dkms -name make.log -type f | tail -n 5
sudo tail -n 120 /var/lib/dkms/*/*/build/make.log 2>/dev/null
Step-by-Step Diagnosis
Verify installed headers and compiler version against running kernel.
dpkg -l | grep -E 'linux-headers|build-essential|dkms'
apt-cache policy linux-headers-$(uname -r)

Solution – Primary Fix
Install headers/toolchain and rebuild DKMS modules for current kernel.
Still having issues? Our Server Management team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo apt update
sudo apt install --reinstall linux-headers-$(uname -r) build-essential dkms -y
sudo dkms autoinstall
sudo update-initramfs -u

Solution – Alternative Approaches
Boot prior kernel while waiting for module vendor compatibility release.
grep menuentry /boot/grub/grub.cfg | grep Advanced -n
Verification & Acceptance Criteria
dkms status shows modules built/installed for active kernel.
dkms status
modprobe
Rollback Plan
Revert kernel package if module support is unavailable.
apt-cache madison linux-image-generic
sudo apt install linux-image-VERSION linux-headers-VERSION -y
Prevention & Hardening
Test kernel updates on staging hosts before broad rollout.
Automate patch management and compliance across your fleet with our DevOps services.
sudo apt-mark hold linux-generic
Related Errors & Cross-Refs
Related errors include bad return status for module build on kernel.
Related tutorial: View the step-by-step tutorial for Ubuntu 24.04 LTS.
View all Ubuntu 24.04 LTS tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
DKMS documentation and Ubuntu kernel packaging references.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.