Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How linux installs device drivers

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Two Ways to Find Drivers

I. User Interface

If you're new to Linux and have just moved from Windows or Mac OS, you'll be glad to know that Linux also provides a wizard-like way to check if a driver is available. Ubuntu offers an add-on driver option. Other Linux distributions also provide helper programs, like GNOME's package manager, which you can use to check whether drivers are available.

II. Command Line

What if you can't find the driver through the nice user interface? Maybe you can only go through a shell without any graphical interface? You can even use the console to showcase your skills. You have two choices:

1. through a warehouse

This is similar to the homebrew command line in MacOS. By using yum, dnf, apt-get, etc. You can basically add repositories and update the package cache.

Download, compile, and build your own.

This usually involves downloading source packages directly from the network or via the wget command, then running configuration and compilation and installation. That's outside the scope of this article, but you can find plenty of online guides on the web if you choose this path.

Check if this driver is already installed

Before we go any further with installing Linux drivers, let's learn a few commands to check if the driver is already available on your system.

The lspci command displays details of all PCI buses and device drivers on the system.

$ lscpci

Or use grep:

$ lscpci | grep SOME_DRIVER_KEYWORD

For example, you can use LSPCI.| grep SAMSUNG command if you want to know if Samsung drivers have been installed.

The dmesg command displays all kernel-recognized drivers.

$ dmesg

Or use with grep:

$ dmesg | grep SOME_DRIVER_KEYWORD

Any identified drivers are displayed in the results.

If you don't recognize any drivers with the dmesg or lscpi commands, try either command to see if the drivers are at least loaded onto the hard disk.

$ /sbin/lsmod

and

$ find /lib/modules

Tip: As with lspci or dmesg, by adding after the command above| Grep filters the results.

If a driver has been identified but not found via lscpi or dmesg, this means that the driver is already present on the hard disk but not loaded into the kernel. In this case, you can load the module via modprobe.

$ sudo modprobe MODULE_NAME

Use sudo to run this command because the module is installed with root privileges.

Add Warehouse and Install

There are several different ways to add a repository: yum, dnf, and apt-get; it's beyond the scope of this article to go through them one by one. To put it simply, this example will use apt-get, but this command is similar to the others.

Delete the existing repository, if it exists

$ sudo apt-get purge NAME_OF_DRIVER*

where NAME_OF_DRIVER is the possible name of your driver. You can also add pattern matching to regular expressions for further filtering.

Add the repository to the repository table, which should be specified in the driver guide

$ sudo add-apt-repository REPOLIST_OF_DRIVER

Where REPOLIST_OF_DRIVER should be specified from the driver documentation (e.g. epel-list).

3. Update warehouse list

$ sudo apt-get update

4. Install the driver

$ sudo apt-get install NAME_OF_DRIVER

5. Check installation status

As mentioned above, check whether the driver has been installed successfully with the lscpi command.

The above is how to install device drivers in linux details, more please pay attention to other related articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report