LinuxCommandLibrary

depmod

TLDR

Generate module dependencies

$ depmod
copy
Generate for specific kernel version
$ depmod [5.15.0-generic]
copy
Force regeneration of all maps
$ depmod -a
copy
Show what would be done
$ depmod -n
copy
Generate for modules in specific directory
$ depmod -b [/path/to/root]
copy
Show verbose output
$ depmod -v
copy

SYNOPSIS

depmod [options] [kernelversion_]

DESCRIPTION

depmod generates module dependency files (modules.dep and related files) used by modprobe to load kernel modules and their dependencies automatically. It analyzes all modules in the kernel module directory and determines their interdependencies.
The tool scans module files for exported and required symbols, building a dependency tree. This information allows modprobe to load prerequisite modules automatically when a module is requested.
depmod is typically run automatically during kernel installation or module updates. The generated files are stored in /lib/modules/<kernel_version>/.

PARAMETERS

KERNELVERSION_

Kernel version to process (defaults to running kernel).
-a, --all
Probe all modules.
-n, --dry-run
Show what would be done without writing files.
-b, --basedir DIR
Use directory as module tree root.
-e, --errsyms
Report unresolved symbols.
-v, --verbose
Verbose output.
-w
Warn on duplicate modules.
-C, --config FILE
Use specified configuration file.
--help
Display help information.

CAVEATS

Requires root privileges to write dependency files. Should be run after adding or removing kernel modules. Running kernel modules cannot be unloaded without considering running processes.

HISTORY

depmod is part of the kmod utilities (formerly module-init-tools), used for Linux kernel module management since the early days of loadable kernel modules in the 1990s.

SEE ALSO

modprobe(8), lsmod(8), insmod(8), rmmod(8)

Copied to clipboard