depmod

system managementLinux
The depmod command is one of the most frequently used commands in Linux/Unix-like operating systems. depmod Generate a dependency file for kernel modules

Quick Reference

Command Name:

depmod

Category:

system management

Platform:

Linux

Basic Usage:

depmod -a

Common Use Cases

  • 1

    Kernel module management

    Build a list of module dependencies for the Linux kernel

  • 2

    System updates

    Update module dependency information after kernel updates

  • 3

    Driver installation

    Configure new hardware drivers to be properly recognized

  • 4

    Troubleshooting

    Resolve module loading issues by rebuilding dependency information

Syntax

depmod [options] [version]

Options

Option Description
-a, --all Probe all modules (default behavior)
-A, --quick Only rebuild if needed
-b, --basedir Use an alternate root directory
-C, --config Use a custom configuration file
-e, --errsyms Report unresolved symbols
-E, --filesyms Use symbols from specified file
-F, --filesyms Use symbols from System.map file
-h, --help Display help information
-n, --show-depends Show module dependencies
-v, --verbose Be verbose about what is being done
-V, --version Show version information

Examples

How to Use These Examples

The examples below show common ways to use the depmod command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.

# Basic Examples Basic
depmod
Generate module dependencies for the current kernel.
depmod -a
Rebuild all module dependency information.
# Advanced Examples Advanced
depmod -v Show verbose output while generating dependencies. depmod -A Check if module dependencies need rebuilding. depmod -e Report any modules without symbols. depmod -b /mnt/system Use an alternate root directory for module search. depmod 5.10.0-15-amd64 Generate dependencies for a specific kernel version.

Try It Yourself

Practice makes perfect! The best way to learn is by trying these examples on your own system with real files.

Understanding Syntax

Pay attention to the syntax coloring: commands, options, and file paths are highlighted differently.

Notes

depmod is an essential command for kernel module management in Linux systems. It generates a dependency file that maps which module provides which symbols, allowing the kernel to automatically load required dependencies when loading modules. The generated files are typically stored in /lib/modules/$(uname -r)/ and include: - modules.dep: Lists module dependencies - modules.alias: Maps module aliases to actual module names - modules.symbols: Maps symbols to the modules that provide them It's important to run depmod after: - Installing new kernel modules - Upgrading your kernel - Moving or renaming kernel modules Most package management systems will automatically run depmod when needed, but manual execution may be necessary after custom module installations or modifications. Running depmod without arguments will process modules for the currently running kernel. Specify a version number to generate dependencies for a different kernel version.

Tips & Tricks

1

Use the -a option to automatically load modules

2

Use the -n option to suppress module loading

3

Use the -b base_directory option to specify the base directory for module files

4

Use the -F file option to specify a file containing module names

5

Use the -v option to display verbose output

Common Use Cases

Kernel module management

Build a list of module dependencies for the Linux kernel

System updates

Update module dependency information after kernel updates

Driver installation

Configure new hardware drivers to be properly recognized

Troubleshooting

Resolve module loading issues by rebuilding dependency information

System initialization

Prepare module information during boot or system initialization

Related Commands

These commands are frequently used alongside depmod or serve similar purposes:

Use Cases

1

Kernel module management

Build a list of module dependencies for the Linux kernel

2

System updates

Update module dependency information after kernel updates

3

Driver installation

Configure new hardware drivers to be properly recognized

4

Troubleshooting

Resolve module loading issues by rebuilding dependency information

5

System initialization

Prepare module information during boot or system initialization

Learn By Doing

The best way to learn Linux commands is by practicing. Try out these examples in your terminal to build muscle memory and understand how the depmod command works in different scenarios.

$ depmod
View All Commands