Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to temporarily (until next boot) disable a kernel module.

How can I do this?

share|improve this question
@Rinzwind I'm not trying to blacklist it. I just want to remove it until I reboot. – Seth Jul 6 '13 at 21:55
up vote 5 down vote accepted

Use lsmod to find the name of a kernel module about that you are interested to disable it temporary. After you've found the name, use next command to disable the module:

sudo modprobe -r <module_name>

However, this command will fail with an error message something like FATAL: Module <module_name> is in use if a process is using:

  • the <module_name>
  • a module about that <module_name> directly depends on
  • any module about that <module_name> - through the dependency tree - depends on indirectly.

You can use lsmod | grep <module_name> to obtain the names of the modules which are preventing you from disable temporary a certain module (these module names are listed in the last column).

More about:

share|improve this answer
This doesn't however, disable or 'remove' buildin modules, which will give an FATAL: Module g_serial is builtin. error. – Tim Visee Jun 16 '15 at 13:12

It appears:

sudo modprobe -r moduleName

Achieves what I want. The module is removed and reloaded upon reboot.

share|improve this answer
however, the module is reloaded if Linux thinks it's needed. This may or may not be what you want. – Frederick Nord Jun 20 at 9:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.