How to Fix ‘modprobe: FATAL: Module not found’ in Linux

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 upgrade or dnf 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 (=y in 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.

  1. Open your Linux terminal.
  2. Check the exact version of the currently executing kernel:
    uname -r
  3. Check which kernel module directories physically exist on your disk:
    ls -la /lib/modules/
  4. Compare the two outputs:
    • If uname -r outputs 6.5.0-28-generic, but /lib/modules/ only contains 6.5.0-35-generic, your package manager deleted the older modules during an update.
  5. Reboot your system immediately to load the newly installed kernel:
    sudo reboot
  6. After rebooting, rerun uname -r and execute sudo modprobe <module_name>.

Method 2: Rebuild Kernel Module Dependencies with depmod

Regenerating the module dependency mapping resolves missing alias pointers.

  1. Execute the depmod command for your currently running kernel:
    sudo depmod -a
  2. The -a flag instructs the utility to probe all modules under /lib/modules/$(uname -r) and regenerate fresh modules.dep and modules.alias.bin index files.
  3. 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.

  1. On Ubuntu and Debian systems, install the matching extra modules package:
    sudo apt update
    sudo apt install -y linux-modules-extra-$(uname -r)
  2. On Fedora/RHEL/CentOS systems, ensure the kernel-modules package matches your running release:
    sudo dnf install -y kernel-modules-$(uname -r)
  3. Once the installation completes, run sudo depmod -a and 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.

  1. Ensure kernel development headers are installed:
    sudo apt install -y linux-headers-$(uname -r) build-essential dkms
  2. Check the status of all registered DKMS modules:
    dkms status
  3. If a module shows as installed for an older kernel but not the current one, trigger a rebuild:
    sudo dkms autoinstall
  4. This compiles the module binary against your active kernel release and places the resulting .ko file 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.

  1. Search the active kernel boot configuration for the module name:
    cat /boot/config-$(uname -r) | grep -i <MODULE_NAME>
  2. 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.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.