Home > Package & System Management > modprobe

modprobe: Kernel Module Management

modprobe is a command used to add or remove modules from the Linux kernel. It automatically handles module dependencies, loading or unloading all necessary modules together. It manages modules at a higher level than `insmod` or `rmmod`.

Overview

modprobe is a powerful tool that automatically resolves dependencies between modules when loading or unloading kernel modules. Unlike `insmod` or `rmmod`, `modprobe` operates more flexibly by utilizing module aliases and configuration files (`modprobe.conf` or the `/etc/modprobe.d` directory).

Key Features

  • Load/unload kernel modules
  • Automatic handling of module dependencies
  • Support for module aliases
  • Configuration file-driven operation

Key Options

Operation Control

Generated command:

Try combining the commands.

Description:

`modprobe` Executes the command.

Combine the above options to virtually execute commands with AI.

Usage Examples

Load Module

sudo modprobe <module_name>

Loads the specified kernel module. If it has dependencies, they will be loaded along with it.

Remove Module

sudo modprobe -r <module_name>

Removes the specified kernel module and all modules that depend on it.

Load Module with Verbose Output

sudo modprobe -v <module_name>

Outputs the module loading process in detail.

Simulate Module Loading

sudo modprobe -n <module_name>

Checks what actions would be performed without actually loading the module.

Check Module Dependencies

modprobe -D <module_name>

Checks which other modules a specific module depends on.

Tips & Precautions

modprobe deals with kernel modules, which are core components of the system, so caution is advised when using it.

Key Tips

  • Use `modprobe` after running `depmod -a`: After installing new modules or updating existing ones, it's important to run `sudo depmod -a` to keep module dependency information up-to-date.
  • Check logs on module load failure: If module loading fails, you can check the kernel logs using `dmesg` or `journalctl -k` to diagnose the cause.
  • Remove unnecessary modules: Removing unused modules can save system resources and reduce potential security vulnerabilities.

Precautions

Loading incorrect modules or removing critical system modules can lead to system instability or boot failures. The `-f` (force) option, in particular, can cause serious problems for the system and should be used with extreme care.


Same category commands