rmmod is a command-line utility that is used to remove a module (a dynamically loadable kernel object) from the Linux kernel. It is typically used when a module is no longer needed or is causing problems, and needs to be unloaded from the system.
Here are some of the main features of rmmod:
- Remove modules: rmmod is used to remove modules from the Linux kernel. This can be useful if a module is no longer needed, or if it is causing problems with the system.
- Dependency checking: rmmod checks whether other modules depend on the module that is being removed. If other modules depend on the module, rmmod will refuse to remove it.
- Unloading order: When removing a module, rmmod will also unload any modules that depend on it. This is done in the reverse order in which they were loaded.
- Safe removal: rmmod will not remove modules that are currently in use. This prevents the system from crashing or becoming unstable.
Overall, rmmod is a useful tool for managing modules in the Linux kernel. It can be used to remove modules that are no longer needed or causing problems, and it ensures that the removal process is done safely and in the correct order. However, it is important to use rmmod with caution, as removing the wrong module can cause system instability or crashes.
If you encounter the below error while running the command rmmod:
rmmod: command not found
you may try installing the below package as per your choice of distribution:
Distribution | Command |
---|---|
Debian | apt-get install kmod |
Ubuntu | apt-get install kmod |
Alpine | apk add kmod |
Arch Linux | pacman -S kmod |
Kali Linux | apt-get install kmod |
CentOS | yum install kmod |
Fedora | dnf install kmod |
Raspbian | apt-get install kmod |
rmmod Command Examples
1. Remove a module from the kernel:
# sudo rmmod module_name
2. Remove a module from the kernel and display verbose information:
# sudo rmmod --verbose module_name
3. Remove a module from the kernel and send errors to syslog instead of standard error:
# sudo rmmod --syslog module_name
4. Display help:
# rmmod --help
5. Display version:
# rmmod --version