Linux command
modprobe 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Dry run
sudo modprobe -n module_name
Load
sudo modprobe module_name
Remove
sudo modprobe -r module_name
Example
sudo modprobe -r --remove-holders module_name
Example
sudo modprobe -D module_name
Example
modprobe -c
说明
modprobe intelligently adds or removes modules from the Linux kernel. It handles module dependencies automatically using modules.dep and searches for modules in /lib/modules/$(uname -r).
参数
- -v, --verbose
- Print detailed information about operations
- -n, --dry-run
- Preview actions without executing them
- -r, --remove
- Remove module instead of inserting
- -f, --force
- Force loading despite version mismatch
- -q, --quiet
- Suppress errors for missing modules
- -b, --use-blacklist
- Apply blacklist rules from configuration
- -c, --showconfig
- Display effective configuration
- -D, --show-depends
- List module dependencies
- --first-time
- Fail if module already loaded/not loaded
- -i, --ignore-install
- Ignore install commands in configuration
- -w, --wait=TIMEOUT
- Wait and retry if module is busy (on removal)
- -S, --set-version
- Use specified kernel version
- --remove-holders
- Also remove dependent modules (with -r)
FAQ
What is the modprobe command used for?
modprobe intelligently adds or removes modules from the Linux kernel. It handles module dependencies automatically using modules.dep and searches for modules in /lib/modules/$(uname -r).
How do I run a basic modprobe example?
Run `sudo modprobe -n module_name` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -v, --verbose do in modprobe?
Print detailed information about operations