LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

depmod

generate kernel module dependency files

TLDR

Generate module dependencies for the running kernel
$ depmod
copy
Generate for a specific kernel version
$ depmod [6.8.0-generic]
copy
Probe all modules (the default when no filename is given)
$ depmod -a
copy
Quick mode: regenerate only if modules are newer than modules.dep
$ depmod -A
copy
Preview without writing (prints to stdout)
$ depmod -n
copy
Use a staging module tree root
$ depmod -b [/path/to/root] [6.8.0-generic]
copy
Report unresolved symbols against a System.map
$ depmod -e -F [/boot/System.map-6.8.0] [6.8.0-generic]
copy

SYNOPSIS

depmod [-aAenvw] [-b basedir] [-F System.map] [-C config] [kernelversion_]depmod [options] modulefiles_...

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 the running kernel (`uname -r`).
-a, --all
Probe all modules. Enabled by default when no filenames are given.
-A, --quick
Exit silently unless a module is newer than modules.dep.
-b, --basedir DIR
Prepend DIR to /lib/modules/<version>; useful for staging roots.
-o, --outdir DIR
Write generated files to DIR instead of the module tree.
-e, --errsyms
Report symbols a module requires that are not provided by other modules or the kernel.
-F, --filesyms System.map
Use System.map to resolve kernel-provided symbols when using -e.
-E, --symvers Module.symvers
With -e, also report symbol version (modversion) mismatches.
-n, --show, --dry-run
Print resulting modules.dep and map files to stdout instead of writing them.
-v, --verbose
Print each symbol dependency and providing module.
-w
Warn about duplicate dependencies, aliases, or symbol versions.
-C, --config FILE
Override the default configuration file or directory.
-V, --version
Show version and exit.
-h, --help
Display help information.

CONFIGURATION

/etc/depmod.conf or **/etc/depmod.d/*.conf**

Configuration files specifying module search paths and overrides.

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), kmod(8)

Copied to clipboard
Kai