How to use rmmod command.

How To Use Rmmod Command.

In this article, we’ll talk about how to use the rmmod command to remove modules from the Linux Kernel.

The core component of each Linux operating system is the Linux kernel. It manages the system’s resources, and acts as an intermediary between the computer’s hardware and software.


rmmod Command

The general syntax for the rmmod (remove module) command is as follows:


On modern Linux systems, rmmod is part of kmod, a binary that implements multiple programs used to manage Linux kernel modules.

Only users with administrative privileged can remove modules.

You can print a list of all modules loaded on your system with the lsmod command. The Kernel modules are stored in the /lib/modules/<kernel_version> directory.

Removing a module with the rmmod command is pretty simple; simply invoke the command followed by the module name:

rmmod module_name

The command prints message only if something goes wrong. For example, if another module uses the module, the command will print something like this:

rmmod: ERROR: Module module_name is in use by: module_name_2

To display information about what the command is doing, use the -v (–verbose) option.

If you want to remove a module that is being used or not designed to be removed, invoke the command with the -f (–verbose) option. Using this option is extremely dangerous as it can cause a system crash.

rmmod also accepts multiple modules as arguments:

rmmod module_name1 module_name2


Prevent a Kernel Module from Loading at Boot-Time

When a module is removed using the rmmod command, the module remains unloaded until the system is rebooted. On the next system boot, the removed module will be loaded.

To permanently disable a Kernel module from loading at boot-time, create a .conf file with any name inside the /etc/modprobe.d. The syntax is:

blacklist module_name

If you want to blacklist additional modules, specify the modules on a new line, or create a new .conf file.

If you want to blacklist additional modules, specify the modules on a new line, or create a new .conf file.



The rmmod command is used to remove Linux kernel modules. Generally, most Linux users are using the modprobe -r command instead of rmmod.