rmmod command is used to remove modules from the Linux Kernel. As well as modprobe, rmmod is a part of kmod.
But in most cases, you should use modprobe -r instead of rmmod because it has a stronger impact without any dependencies.
This article will show you how to use the rmmod command in Linux as we go through below.
The syntax of rmmod command
To remove a Linux kernel module, run rmmod provided you are root user.
$ rmmod [options] module_name
-v, –verbose show information
-f, –force remove modules that is being used or not designer to be removed
-w, –wait isolate module and wait until module is longer in use
-s, –syslog send errors to syslog instead of to the terminal
-V, –version show rmmod’s version information, and exit
You can use lsmod command to check which modules are already loaded.
Now, I will try to remove aesni_intel module by rmmod:
$ sudo rmmod -f aesni_intel
Use the lsmod command to check if nfit is removed:
$ lsmod | grep aesni_intel
If aesni_intel is removed, nothing will show up anymore:
rmmod also accepts deleting multiple modules:
$ rmmod module_name1 module_name2
You’ve already gone through the details of how to remove modules by rmmod from the Linux kernel.
Thanks for reading.