Resolving Linux Kernel Module modprobe Not Found Issue: The depmod Command Explained

Dec 02, 2025 · Programming · 12 views · 7.8

Keywords: Linux | kernel module | modprobe | depmod | persistent loading

Abstract: This article addresses a common issue in Linux where the modprobe command fails to locate a kernel module even after installation. We explore the role of the depmod command in creating module dependency lists, provide step-by-step solutions to resolve the problem, and discuss methods for persistent module loading across reboots. Key topics include kernel module management, modprobe, and system configuration.

Problem Description

In Linux systems, installing custom kernel modules is a common task for developers and administrators. A frequent issue encountered is when the modprobe command reports that a module is not found, even though the corresponding .ko file is present in the correct directory under /lib/modules/$(uname -r)/. This problem often arises after manual compilation and installation of modules, such as the acpi_call module from GitHub.

Understanding modprobe and Kernel Module Loading

The modprobe command is used to load and unload Linux kernel modules. It relies on a dependency database located at /lib/modules/$(uname -r)/modules.dep, which is generated by the depmod utility. When a module is installed via make install, the .ko file is typically placed in a subdirectory like extra/, but modprobe may not recognize it until the dependency list is updated.

The Role of the depmod Command

depmod scans the /lib/modules/$(uname -r)/ directory and its subdirectories to create or update the modules.dep file. This file contains the dependencies between modules, allowing modprobe to locate and load them correctly. Running sudo depmod after module installation ensures that the system's module database is synchronized with the newly added files.

Step-by-Step Resolution

To resolve the "module not found" error, follow these steps:

  1. Verify that the module file (e.g., acpi_call.ko) is in the appropriate directory, such as /lib/modules/$(uname -r)/extra/. You can check the kernel version with uname -r.
  2. Run the depmod command to update the dependency database:
  3. sudo depmod
  4. Attempt to load the module using modprobe:
  5. sudo modprobe acpi_call
  6. If successful, the module should be loaded, and you can verify with lsmod | grep acpi_call.

Persistent Module Loading

To ensure the module loads automatically on boot, you can add it to the system's configuration. Common methods include:

For example, create a file /etc/modules-load.d/acpi_call.conf with the content:

acpi_call

Conclusion

The "module not found" error with modprobe is often resolved by running depmod to update the module dependency database. This highlights the importance of maintaining synchronized module lists in Linux kernel management. By understanding and applying these commands, users can effectively install and persist custom kernel modules.

Copyright Notice: All rights in this article are reserved by the operators of DevGex. Reasonable sharing and citation are welcome; any reproduction, excerpting, or re-publication without prior permission is prohibited.