Attempting to load a kernel module for hardware drivers, cryptographic ciphers, VPN tunnels, or virtualization in Linux using the command sudo modprobe <module_name> only to be met with the fatal error modprobe: FATAL: Module <module_name> not found in directory /lib/modules/$(uname -r) halts hardware initialization immediately. In Linux kernel architecture, loadable kernel modules (LKMs) are compiled binary drivers (.ko files) dynamically linked into the running kernel at runtime. When you run modprobe, the utility consults pre-computed module dependency index files (modules.dep.bin) located inside the kernel release directory under /lib/modules/. If an operating system package upgrade installed a new kernel package without rebooting, if module dependencies were not rebuilt via depmod, or if the driver requires out-of-tree compilation, modprobe fails to locate the file. This guide explains how Linux manages kernel modules and details proven methods to resolve this fatal error.
What Causes ‘modprobe: FATAL: Module not found’?
Module lookup failures occur when the modprobe utility cannot locate a matching binary driver for the currently running kernel:
- Pending Kernel Reboot Discrepancy: A system package upgrade (
apt upgradeordnf update) installed an updated kernel version and removed the older module directory from/lib/modules/. Because the system was not rebooted, the running kernel (uname -r) searches a deleted directory. - Corrupted or Outdated Dependency Tree (depmod): The binary index files (
modules.dep,modules.alias) are missing or outdated, preventing modprobe from mapping module aliases. - Out-of-Tree Driver Not Compiled (DKMS Failure): Proprietary drivers (like NVIDIA, WireGuard, or VirtualBox guest additions) failing to compile via Dynamic Kernel Module Support (DKMS) during kernel upgrades.
- Built-in Kernel Feature: The requested feature was compiled directly into the monolithic kernel image (
=yin kernel config) rather than as a loadable module (=m), meaning modprobe is unnecessary. - Missing Linux Modules Extra Package: Minimal cloud images (Ubuntu Minimal, AWS AMIs) omitting secondary driver packages by default.
Method 1: Verify Running Kernel vs Installed Modules Directory
The most common cause of this error is a kernel package update executed without a subsequent reboot.
- Open your Linux terminal.
- Check the exact version of the currently executing kernel:
uname -r - Check which kernel module directories physically exist on your disk:
ls -la /lib/modules/ - Compare the two outputs:
- If
uname -routputs6.5.0-28-generic, but/lib/modules/only contains6.5.0-35-generic, your package manager deleted the older modules during an update.
- If
- Reboot your system immediately to load the newly installed kernel:
sudo reboot - After rebooting, rerun
uname -rand executesudo modprobe <module_name>.
Method 2: Rebuild Kernel Module Dependencies with depmod
Regenerating the module dependency mapping resolves missing alias pointers.
- Execute the
depmodcommand for your currently running kernel:sudo depmod -a - The
-aflag instructs the utility to probe all modules under/lib/modules/$(uname -r)and regenerate freshmodules.depandmodules.alias.binindex files. - If no errors are returned, test loading the module again:
sudo modprobe <module_name>
Method 3: Install Missing Kernel Modules Extra Packages
Cloud and minimal Linux distributions frequently strip non-essential drivers into optional packages.
- On Ubuntu and Debian systems, install the matching extra modules package:
sudo apt update sudo apt install -y linux-modules-extra-$(uname -r) - On Fedora/RHEL/CentOS systems, ensure the kernel-modules package matches your running release:
sudo dnf install -y kernel-modules-$(uname -r) - Once the installation completes, run
sudo depmod -aand load the module.
Method 4: Rebuild Out-of-Tree Drivers via DKMS
Recompiling third-party drivers (such as NVIDIA, VirtualBox, or custom Wi-Fi drivers) against the active kernel headers.
- Ensure kernel development headers are installed:
sudo apt install -y linux-headers-$(uname -r) build-essential dkms - Check the status of all registered DKMS modules:
dkms status - If a module shows as installed for an older kernel but not the current one, trigger a rebuild:
sudo dkms autoinstall - This compiles the module binary against your active kernel release and places the resulting
.kofile into/lib/modules/$(uname -r)/updates/dkms/.
Method 5: Check if the Feature Is Already Built-in to the Kernel
If a driver is compiled directly into the kernel core, modprobe will report it not found even though it is active.
- Search the active kernel boot configuration for the module name:
cat /boot/config-$(uname -r) | grep -i <MODULE_NAME> - Interpret the result:
CONFIG_FEATURE=m: The driver is built as an external loadable module.CONFIG_FEATURE=y: The driver is built directly into the core kernel image. You do not need to run modprobe because the capability is already active in memory.