• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • AI Agents
    • OpenClaw
    • Claude Code
    • n8n
    • Hermes Agent
    • Open WebUI
    • Docker
  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
    • Email Hosting
    • HeroicGuard
    • GPU Hosting
    • Website Builder
  • VPS
    • Managed VPS
    • Unmanaged VPS
    • Flex VPS
  • Reseller
  • Gaming
  • Domains
  • Account
  • Blog Home
  • Categories
  • Authors

The Modprobe Command: Everything You Need To Know

Benjamin O'Donald

Published on: February 5, 2025

Categories: Linux Command Line 0

Table of Contents
  • What is the Linux kernel?
  • What is a kernel module?
  • What is the modprobe command?
  • Options for the modprobe command
  • How to install a single module using the modprobe command in Linux
    • #1. Install a Linux kernel module with modprobe
    • #2. Confirm if the Linux kernel module has been installed
  • How to install multiple modules using the modprobe command
    • #1. Install multiple modules using the modprobe command
    • #2. Verify the kernel modules have been installed
  • How to remove modules the modprobe command
    • #1. Remove a kernel module with modprobe
    • #2. Confirm the module has been removed
  • How to list loaded kernel modules in Linux
    • List loaded kernel modules with lsmod
    • Using the find command to list loaded kernel modules
  • How to blacklist modules using modprobe
  • How to check the modprobe version in Linux
  • Conclusion

What is the Linux kernel?

The kernel is the “brain” and core piece of the Linux operating system and the kernel’s functionality is to serve as an interface for interaction between system software and hardware.

Linux kernel updates are released periodically to improve security, fix issues discovered in a previous release, provide new features, and add compatibility for newer hardware.

What is a kernel module?

A kernel module is an object/file that contains code which overall extends the functionality of the kernel.

Adding kernel modules can provide compatibility for new hardware, expand on current system security and so on.

These modules can be loaded and unloaded with the use of modprobe so that a reboot of the system is not required during those tasks. This makes adding new temporary modules easy to add and remove as needed.

What is the modprobe command?

The modprobe command in Linux works with the kernel and is available by default in most all Linux distributions.

Linux users utilize the modprobe command to manage modules when removing a module or loading a module into the kernel.

With the modprobe command we are able to load modules into the kernel and it will automatically install needed module version dependencies or dependent modules.

Within this article we will use the modprobe command to show its basic usage and help you get started.

Options for the modprobe command

Below is a list of common usage options for modprobe that can be utilized when managing kernel modules.

Each of the following options can be included in a modprobe command to suite your specific task.

  • -a (this is used when you need to insert or removal more than one module within a command)
  • -r (this is used to remove a module)
  • –remove-dependencies (this will remove dependencies for a module)
  • -R (this is used to review all matching module names of an alias )
  • –first-time (this outputs information on if a module has been inserted or removed)
  • -i (this is used to ignore any install or remove commands written for a module when you are inserting or removing a module)
  • -b (you can create a blacklist for modules which should not be auto-loaded and this flag uses that list)
  • -f (forces removal or insert of a module when there is a version error)
  • –dry-run (runs the command as a test and provides output to help with debugging modules)
  • -q (turns off error messages for a command)
  • -V (this will show the mobprobe version)
  • -h (used to display the help message to show command options)

How to install a single module using the modprobe command in Linux

Note: In all of these below command examples we’ll be using ‘sudo modprobe’ as we’re assuming these are being executed as a sudo privileged user.

If you are running any of the below command as ‘root’ you will not need to add ‘sudo’ into the beginning of the command.

#1. Install a Linux kernel module with modprobe

In the below example we’ll use the modprobe command with the following syntax on the command line interface to install one specific module:

(replace module_name with the desired module you wish to load into the kernel)

$ sudo modprobe module_name

From the above example the modprobe command adds the new module and it is automatically loaded into the kernel.

#2. Confirm if the Linux kernel module has been installed

Now lets confirm we successfully loaded the module into the kernel with the same modprobe command but using –first-time at the end as an option:

$ sudo modprobe module_name --first-time

Running the above modprobe command will show an error message such as in the following to let you know the kernel module is already loaded:

As we see from above the “module already in kernel” error message indicates this has been installed/loaded into the kernel already so we’re all set.

How to install multiple modules using the modprobe command

#1. Install multiple modules using the modprobe command

Lets say you have a list of different modules you’d like load into the Linux kernel.

To add multiple modules with modprobe we would utilize the -a flag while separating each module with a space.

The general syntax of adding multiple modules is as follows:

(replace module_name with the desired module you wish to load into the kernel)

$ sudo modprobe -a module_name1 module_name2

#2. Verify the kernel modules have been installed

Whenever you’re installing or removing modules it is always suggested to check your work and confirm.

We’ll just use the –first-time option once more in the same command to verify:

$ sudo modprobe -a module_name1 module_name2 --first-time

How to remove modules the modprobe command

#1. Remove a kernel module with modprobe

To remove modules from the Linux kernel we’ll utilize the ‘sudo modprobe -r’ command such as in the following example:

(replace module_name with the desired module you wish to uninstall/remove from the kernel)

$ sudo modprobe -r module_name

#2. Confirm the module has been removed

To confirm you have removed/unloaded a module from the Linux kernel you would run the same ‘sudo modprobe -r’ command again but add in the –first-time option:

$ sudo modprobe -r module_name --first-time

Just like within the installation section where we ran –first-time you’ll receive an error message which indicates the module is not installed.

If the output of the above shows “the module is not in the kernel” you should be all set and the module has been removed successfully.

How to list loaded kernel modules in Linux

When using modprobe to add/remove modules you may need to know the list of loaded modules which already exist.

Linux kernel module locations on the file system are set to /lib/modules or /usr/lib/modules and there are a couple of ways to view loaded modules.

List loaded kernel modules with lsmod

One way to list all loadable kernel modules in the module directory is to use the following command:

$ lsmod

You could also grep for a specific module to see if it is loaded into the kernel:

$ lsmod | grep module_name

Using the find command to list loaded kernel modules

Alternatively you can also use the ‘find’ command on the module directory to locate all of your installed kernel modules such as with the following:

$ find /lib/modules/$(uname -r) -type f -name '*.ko*'

This may be a long list so you could also pipe ‘less’ into the command such as in this example:

$ find /lib/modules/$(uname -r) -type f -name '*.ko*' | less

By using ‘less’ within the command you can scroll through the results with your middle mouse button or the space bar.

How to blacklist modules using modprobe

At times it may be needed to block a module from being used by the systems kernel and with modprobe we’re able prevent certain kernel modules from automatically loading into the kernel or prevent them from loading at all.

In order to add a module into a blacklist you’ll need to manually add the following into the current configuration within the following file path:

/etc/modprobe.d/

Within this location you will want to create a new conf file named after the module you would like to blacklist such as with the following example:

$ echo "blacklist module_name" > /etc/modprobe.d/module_name.conf

Or you could also blacklist it from becoming a loaded module by creating the file with vim:

vim /etc/modprobe.d/module_name.conf

And add in the following to the file:

blacklist module_name

In the above example you would need to replace ‘module_name’ with the module you wish to blacklist.

How to check the modprobe version in Linux

To simply check the version of modprobe on the Linux command line interface you would just run the following command:

$ sudo modprobe -V

You can also use the –version within the modprobe command to achieve the same results:

$ sudo modprobe --version

Output from either of the above would show similar to the following:

Conclusion

The kernel is the most important component of a Linux operating system and you may find yourself needing to install new modules for the kernel to extend compatibility with new hardware or improve security.

In this article we went over the basic usage of the modprobe command which can be used to manage kernel modules such as loading modules, removing modules and how to obtain an active module loaded list.

Related Posts

Docker Build Cache – How it Works and Invalidating it

Docker heavily optimizes its build process with caching to save time. But it's important to know how to invalidate it.

How to Prune Unused Images in Docker

In Docker, containers and images can build up over time, using up space and resources. Here's how to get rid of them.

Bash Debug Mode: set -x and the PS4 Variable

When coding a program, you usually have a full IDE set up with autocomplete and stack tracing, allowing you to pause execution at any point and see what’s going on under the hood. These tools make coding more productive, and they’ve been in use for a long time. But what if you’re just quickly coding […]

How to Use Ufw to Open Port 80 in Linux

In Linux, particularly on Ubuntu system, here's how we can use ufw to open port 80. No need to mess with IPTables directly!

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • OpenClaw Hosting
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • Managed VPS Hosting
  • Unmanaged VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • GPU Hosting
  • Email Hosting
  • HeroicGuard
  • Domains
  • Website Builder
  • AI Agent Hosting
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2026 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA