Share your love
Manually Install Driver Module in Linux with 3 Easy Steps
This tutorial intends to teach you to Manually Install Driver Module in Linux. Simply put, a driver module is a kind of software needed to communicate with hardware components. In this guide on the Orcacore website, we want to manually show you a complete installation of the driver module in Linux.
Table of Contents
Steps To Manually Install Driver Module in Linux
To Manually Install Driver Module in Linux, you must have access to your server as a root or non-root user with sudo privileges. Then, follow the steps below to complete this guide by using the Linux Commands.
Step 1 – List All Linux Kernel Modules or Drivers
First, you can use the following command to see your current Linux kernel drivers:
ls /lib/modules/$(uname -r)
You will get something similar to this in your output:
Then, you can run the following command to list all Linux driver modules for various devices:
ls /lib/modules/$(uname -r)/kernel/drivers/
In your output, you will see:
Step 2 – Update Drivers on Linux using Terminal
You can update your Linux drivers to fix security, and errors, and sometimes even add features to the hardware.
To do this, you can easily run the system update by using your Linux package manager to update your drivers.
On Ubuntu / Debian, you can run the system update with the command below:
# sudo apt update
# sudo apt upgrade
On Centos 7 / RHEL 7, you can use the following command:
# sudo yum update -y
# sudo yum upgrade -y
And you can use the command below on AlmaLinux / Rocky Linux / RHEL 8 and 9:
# sudo dnf update -y
# sudo dnf upgrade -y
Step 2 – Are Drivers Automatically Installed in Linux?
When you connect a device to your Linux system, a device file will be created in the /dev directory. Most of the driver modules are available in your system. But for some of them, you need to Manually Install Driver Module in Linux.
Step 3 – How To Install Missing Driver Module in Linux?
Before you start to Manually Install Driver Module in Linux, you need to be sure whether the driver is already available on your system or not. To do this, you can use the following Linux commands:
# lscpci | grep driver-name
Or
# dmesg | grep driver-name
If the driver exists, you will get the results.
If you get nothing in your output, you need to find out if the driver is at least loaded on the disk by using the command below:
# /sbin/lsmod
Or
# find /lib/modules
Load Linux Driver Module
If a driver is found by these commands but not by the lscpi or dmesg commands, it means the driver is on the disk but not in the kernel. In this case, you need to load the module with the modprobe command:
modprobe module-name
Add Repository and Install Driver Module in Linux
At this point, you can use the package manager of your Linux distro like apt, yum, and dnf to add the driver repository and install it. Here we use apt and it is the same as other options.
If the driver repository exists on your Linux system, delete it with the command below:
apt purge driver-name
Then, add your driver repository with the command below:
add-apt-repository driver-repolist
Note: driver-repolist should be specified in the driver documentation.
Finally, update your system and Manually Install Driver Module in Linux with the command below:
# apt update
# apt install driver-name
How do you check if all drivers are installed in Linux?
You can verify your Linux driver installation, by using the commands below:
# lscpci | grep driver-name
Or
# dmesg | grep driver-name
Conclusion
At this point, you have learned to Manually Install Driver Module in Linux. As you saw, you can easily list your all available Linux kernel modules and install missing drivers, load the modules, and install them.
Hope you enjoy it. You may be interested in these articles:
Install build-essential on Ubuntu 22.04