How to Fix ‘Module Not Found’ After Kernel Update in Ubuntu

Following a system update or distribution upgrade on Ubuntu, running terminal commands like modprobe, launching virtual machines in VirtualBox, mounting file systems, or initializing Wi-Fi and GPU drivers can suddenly fail with the error: “modprobe: FATAL: Module [module_name] not found in directory /lib/modules/[kernel_version]”.

This failure occurs when the actively running Linux kernel in memory does not match the newly installed kernel version on disk, or when out-of-tree Dynamic Kernel Module Support (DKMS) modules failed to compile for the upgraded kernel header tree. Follow these structured terminal commands to synchronize kernel modules and restore driver functionality.

Reboot the System to Initialize the Upgraded Kernel

The most frequent cause of “Module not found” errors occurs immediately after running sudo apt upgrade while your system remains running on the older kernel image in RAM.

  1. Check the kernel version currently loaded in active memory:
    uname -r
  2. Check which kernel module directory exists on disk:
    ls /lib/modules/
  3. If the output of uname -r points to an older version (e.g. 6.8.0-40-generic) while /lib/modules/ contains only a newer directory (e.g. 6.8.0-45-generic), your system simply requires a reboot.
  4. Reboot your system:
    sudo reboot
  5. Upon rebooting, Ubuntu will boot into the newest kernel matched to the module directory, resolving the error immediately.

Rebuild Kernel Module Dependencies with depmod

If the kernel versions match but modprobe fails to find existing compiled modules, the binary module index file (modules.dep) is corrupted or outdated.

  • Rebuild the module dependency mapping tree for your running kernel:
    sudo depmod -a
  • If troubleshooting a specific installed kernel version, pass its exact version string:
    sudo depmod -a $(uname -r)
  • Test loading your module again using sudo modprobe [module_name].

Rebuild Missing DKMS Modules for the Current Kernel

Proprietary drivers (such as NVIDIA display drivers, VirtualBox host modules, and Realtek/Broadcom wireless drivers) use DKMS to compile modules dynamically during kernel updates. If compilation was interrupted, the modules remain missing.

  1. Install the matching Linux kernel headers package required for compilation:
    sudo apt update && sudo apt install -y linux-headers-$(uname -r) build-essential dkms
  2. Check the status of all registered DKMS module packages:
    dkms status
  3. Look for modules marked as added or broken rather than installed.
  4. Force an automatic rebuild and installation across all kernel trees:
    sudo dkms autoinstall
  5. If a specific module fails, re-install it explicitly (for example, VirtualBox):
    sudo dpkg-reconfigure virtualbox-dkms

Boot into an Older Kernel via GRUB Advanced Options

If a newly installed kernel regression prevents essential storage, network, or graphics modules from loading, booting into your previous working kernel restores stability.

  • Restart your PC. When booting starts, hold down the Shift key (BIOS) or press Esc repeatedly (UEFI) to reveal the GRUB menu.
  • Select Advanced options for Ubuntu.
  • Highlight your previous kernel version (e.g. Ubuntu, with Linux 6.8.0-40-generic) and press Enter.
  • Once booted safely on the older working kernel, remove the problematic broken kernel package:
    sudo apt purge linux-image-6.8.0-45-generic linux-headers-6.8.0-45-generic
  • Update your bootloader: sudo update-grub.

Reinstall the Generic Kernel Metapackage

If partial package manager failures stripped core kernel modules from /lib/modules/, reinstalling the master metapackage pulls down complete binaries.

  1. Reinstall the default Ubuntu generic kernel stack:
    sudo apt install --reinstall linux-image-generic linux-headers-generic
  2. Update initial RAM file systems:
    sudo update-initramfs -u -k all
  3. Update the GRUB configuration:
    sudo update-grub
  4. Reboot your machine to confirm that all required kernel modules initialize cleanly.

Get the best tech tips delivered straight to your inbox.

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