modprobe Command in Linux: Load and Manage Kernel Modules

A network card that does not show up, a driver that needs a different parameter, or an open-source graphics driver that conflicts with the one you want to install: all of these problems lead to the same tool.
modprobe is a command-line utility that adds and removes modules from the Linux kernel. It loads a module by name, automatically loads any modules it depends on, and applies the options defined in /etc/modprobe.d/.
This guide explains how to use modprobe to load, unload, reload, blacklist, and configure kernel modules.
Kernel Modules
The Linux kernel is the core component of the Linux operating system. It manages the system’s resources and acts as a bridge between your computer’s hardware and software.
The Linux kernel has a modular design. A kernel module, often referred to as a driver, is a piece of code that extends the kernel’s functionality. Modules are either compiled as loadable modules or built into the kernel. Loadable modules can be loaded and unloaded in the running kernel on request, without the need to reboot the system.
Generally, modules are loaded on demand by udev (the device manager). However, sometimes you may need to fine-tune how modules are loaded. For example, you may need to load a module with additional parameters or prevent a module from loading automatically.
You can manually load a module into the kernel using the modprobe command, or automatically at boot time using /etc/modules-load.d/*.conf files. modprobe is part of kmod, a package that implements multiple utilities for managing Linux kernel modules.
Syntax
The general syntax for the modprobe command is:
modprobe [OPTIONS] module_name [parameter=value ...]Common options:
-r- Remove (unload) a module from the kernel-a- Treat every argument as a module name, so you can load several modules at once-v- Verbose mode, show each step as modules are loaded or unloaded-n- Dry run, do everything except actually load or unload the module-c- Show the current modprobe configuration--show-depends- List the dependencies of a module without loading it-q- Quiet mode; suppress “module not found” messages, but still return a non-zero exit status--first-time- Fail if the module is already loaded (useful in scripts)
Loading Kernel Modules
Kernel modules are stored in the /lib/modules/<kernel_version> directory. You can find the version of the running kernel
with the uname -r
command.
Only users with administrative privileges can manage kernel modules.
To load a module, invoke modprobe followed by the module name:
sudo modprobe module_namemodprobe loads the given module and any dependencies it requires. By default, everything after the module name is treated as a module parameter. To load several modules in one command, use the -a option:
sudo modprobe -a overlay br_netfilterUse the lsmod
command to confirm that the module is loaded:
lsmod | grep module_nameTo see exactly what modprobe does when loading a module, add the -v (verbose) flag:
sudo modprobe -v module_nameTo preview the actions modprobe would take without loading a module, use the -n (dry run) option together with -v:
sudo modprobe -n -v module_nameA dry run does not ask the kernel to load the module, so it cannot verify signatures, kernel compatibility, or parameter values.
Loading Modules with Parameters
Some modules accept parameters that change their behavior. To load a module with parameters, pass them as parameter=value pairs after the module name:
sudo modprobe module_name parameter=valueThe command accepts multiple parameter=value pairs separated by spaces.
To see what parameters a module supports, use modinfo:
modinfo -p module_nameMaking Parameters Persistent
To set module parameters that apply every time the module is loaded, create a configuration file in /etc/modprobe.d/. Files must end with .conf and can have any name:
options module_name parameter=valueFor example, to always load the snd_hda_intel sound module with power_save=1:
options snd_hda_intel power_save=1The settings in /etc/modprobe.d/ are read by modprobe every time the module is loaded, whether manually or at boot.
Loading Modules at Boot
To load a module automatically at boot time, add its name to a file in /etc/modules-load.d/. Each file lists one module name per line:
br_netfilter
vhost_netThese files are read by systemd-modules-load during startup. They only specify which modules to load; for parameters, use a separate file in /etc/modprobe.d/ as described above.
Removing Kernel Modules
To unload a module, invoke modprobe with the -r option followed by the module name:
sudo modprobe -r module_namemodprobe will also remove any module dependencies that are no longer in use.
When invoked with -r, the command accepts multiple modules as arguments:
sudo modprobe -r module_name1 module_name2rmmod
command to unload a module from the Linux kernel. The difference is that rmmod only removes the specified module, while modprobe -r also removes unused dependencies.Reloading a Module
modprobe has no reload option. To reload a module, for example after changing its options in /etc/modprobe.d/, unload it and load it again:
sudo modprobe -r module_name && sudo modprobe module_nameThe && operator runs the second command only if the module was unloaded successfully. If the module is in use, modprobe -r fails and the module stays loaded with its old settings.
Blacklisting Modules
If you want to prevent a kernel module from loading at boot time, you can blacklist it. Create a .conf file inside the /etc/modprobe.d/ directory:
blacklist module_nameIf you want to blacklist multiple modules, add each one on a new line, or create separate .conf files.
To check how modprobe handles the module after the blacklist is in place, run a dry run with verbose output and -b so blacklist rules are applied to the module name:
sudo modprobe -n -v -b module_nameAfter blacklisting a module, rebuild the initramfs so the change takes effect on the next boot:
sudo update-initramfs -uOn Fedora, RHEL, and Derivatives, use dracut instead:
sudo dracut --forcemodprobe ignore a module’s device aliases. A blacklisted module can still be loaded manually with sudo modprobe module_name or pulled in as a dependency of another module. To block normal loading through modprobe, add install module_name /bin/false to the blacklist file. This override can be bypassed with modprobe --ignore-install or direct loading with insmod.Listing and Inspecting Modules
To list all currently loaded modules, use lsmod
:
lsmodTo view detailed information about a specific module (including its description, author, license, parameters, and file path), use modinfo:
modinfo module_nameFor example, to inspect the br_netfilter module:
modinfo br_netfilterfilename: /lib/modules/7.0.0-31-generic/kernel/net/bridge/br_netfilter.ko.zst
description: Linux ethernet netfilter firewall bridge
author: Bart De Schuymer <bdschuym@pandora.be>
author: Lennert Buytenhek <buytenh@gnu.org>
license: GPL
srcversion: 0FA39ABF64A385B58F6871C
depends: bridge
intree: Y
name: br_netfilter
vermagic: 7.0.0-31-generic SMP preempt mod_unload modversions aarch64
...The filename line shows where the module lives on disk. The .ko.zst extension means the module is compressed with Zstandard, which is the default on current Ubuntu and Fedora releases. The depends line tells you that modprobe will load the bridge module first.
To list only the parameters a module accepts:
modinfo -p module_namemodprobe does not have an option for listing modules. To see all modules that are available for the running kernel, including the ones that are not loaded, search the modules directory:
find /lib/modules/$(uname -r) -type f -name '*.ko*'Pipe the output to grep
to narrow it down, for example | grep -i wifi.
Practical Examples
Loading Modules for Kubernetes
The required modules depend on the node’s container runtime and network plugin. For a node using OverlayFS storage and bridge networking that needs iptables filtering, load both overlay and br_netfilter:
sudo modprobe -a overlay br_netfilterTo load them on every boot, list them in a file under /etc/modules-load.d/:
overlay
br_netfilterBlacklisting the Nouveau Driver
When installing the proprietary NVIDIA driver, you need to blacklist the open-source nouveau driver to prevent conflicts:
blacklist nouveau
options nouveau modeset=0Then rebuild the initramfs and reboot:
sudo update-initramfs -u
sudo rebootChecking Module Dependencies Before Loading
To see what dependencies a module requires without loading anything:
modprobe --show-depends br_netfilterinsmod /lib/modules/7.0.0-31-generic/kernel/net/llc/llc.ko.zst
insmod /lib/modules/7.0.0-31-generic/kernel/net/802/stp.ko.zst
insmod /lib/modules/7.0.0-31-generic/kernel/net/bridge/bridge.ko.zst
insmod /lib/modules/7.0.0-31-generic/kernel/net/bridge/br_netfilter.ko.zstEach line is a module that modprobe would insert, in the order it would insert them. Here, br_netfilter needs bridge, which in turn needs stp and llc. This is useful for debugging when a module fails to load due to missing dependencies.
Quick Reference
| Task | Command |
|---|---|
| Load a module | sudo modprobe module_name |
| Load with parameters | sudo modprobe module_name param=value |
| Load several modules | sudo modprobe -a module1 module2 |
| Unload a module | sudo modprobe -r module_name |
| Reload a module | sudo modprobe -r module_name && sudo modprobe module_name |
| Preview loading a module | sudo modprobe -n -v module_name |
| Show module dependencies | modprobe --show-depends module_name |
| Show modprobe configuration | modprobe -c |
| List loaded modules | lsmod |
| List available modules | find /lib/modules/$(uname -r) -type f -name '*.ko*' |
| View module info | modinfo module_name |
| Blacklist a module | echo "blacklist module_name" | sudo tee /etc/modprobe.d/blacklist-module_name.conf |
| Load at boot | Add module name to /etc/modules-load.d/*.conf |
Troubleshooting
“modprobe: FATAL: Module module_name not found in directory /lib/modules/…”
The module does not exist for the running kernel version. Verify you are looking for the correct name with find /lib/modules/$(uname -r) -name '*.ko*' | grep keyword. On Ubuntu, you may need to install the linux-modules-extra-$(uname -r) package.
“modprobe: ERROR: could not insert ‘module_name’: Operation not permitted”
Loading modules requires root privileges, so first make sure you ran the command with sudo. Inside a Docker or Podman container, the error appears even as root, because containers do not get the CAP_SYS_MODULE capability. Load the module on the host instead. The same error appears when the kernel.modules_disabled sysctl is set to 1; this setting cannot be turned off until the next reboot.
“modprobe: ERROR: could not insert ‘module_name’: Key was rejected by service”
The kernel could not verify the module’s signature. Secure Boot or a kernel configured to enforce module signing can cause this error. Check the signing identity with modinfo -F signer module_name. On Ubuntu, if the module was signed with the key corresponding to /var/lib/shim-signed/mok/MOK.der, enroll that certificate with sudo mokutil --import /var/lib/shim-signed/mok/MOK.der, then reboot and confirm enrollment in the MOK manager. If the module is unsigned, sign it or rebuild it through DKMS before enrolling the matching certificate. If it uses a different signing key, enroll that key’s certificate instead.
“modprobe: command not found”
On minimal systems and container images, the kmod package may not be installed. Install it with sudo apt install kmod on Ubuntu, Debian, and Derivatives, or sudo dnf install kmod on Fedora, RHEL, and Derivatives. On Debian, the error also appears after switching to root with plain su, because /usr/sbin is not added to PATH. Use su - instead.
“modprobe: FATAL: Module module_name is in use.”
The module cannot be unloaded because other modules or processes depend on it. Run lsmod | grep module_name to see what is using it. Unload the dependent modules first, or stop the processes that hold references to the module.
Module loads manually but does not persist across rebootmodprobe only loads a module for the current session. To make it persistent, add the module name to a file in /etc/modules-load.d/ as described in the Loading Modules at Boot
section.
Module is blacklisted but still loads
A blacklist entry prevents automatic loading through device aliases, but it does not block manual loading by name or loading as a dependency. Add install module_name /bin/false to the blacklist file to block normal loading through modprobe, then rebuild the initramfs. As explained in Blacklisting Modules
, --ignore-install and insmod can bypass this override.
FAQ
What is the difference between modprobe and insmod?insmod loads a single module file by its full path and does not resolve dependencies. modprobe loads a module by name, automatically resolves and loads all dependencies, and reads configuration from /etc/modprobe.d/. In practice, modprobe is almost always the better choice.
How do I check if a kernel module is loaded?
Run lsmod | grep module_name. If the command produces output, the module is loaded. You can also check /proc/modules directly.
How do I permanently load a module at boot?
Add the module name (one per line) to a .conf file in /etc/modules-load.d/. For module parameters, create a separate file in /etc/modprobe.d/ with options module_name parameter=value.
How do I undo a blacklist?
Remove or comment out the blacklist module_name line and any matching install module_name /bin/false line in /etc/modprobe.d/. Then rebuild the initramfs with sudo update-initramfs -u (or sudo dracut --force on Fedora/RHEL) and reboot.
Conclusion
The modprobe command loads and unloads kernel modules along with their dependencies, while /etc/modprobe.d/ and /etc/modules-load.d/ handle persistent configuration and boot-time loading. For related commands, see lsmod
for listing loaded modules and rmmod
for removing individual modules.
Tags
Linuxize Weekly Newsletter
A quick weekly roundup of new tutorials, news, and tips.
About the authors

Dejan Panovski
Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 1000+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.
View author page