How to Install a Wi-Fi Adapter Driver on Linux: A Step-by-Step Guide

Transition to an operating system Linux Networking is often associated with a number of technical challenges, and one of the first barriers a user encounters is the lack of a wireless connection. A typical situation where Wi-Fi doesn't work after installing a distribution is common, as many network equipment manufacturers are slow to provide open-source drivers for free software. However, a lack of internet access out of the box doesn't mean the device is faulty or incompatible; most often, it simply requires proper software configuration.

The process of installing drivers in Linux is fundamentally different from the usual procedure in Windows, where it is enough to run the installer .exeIn the open-source world, you'll be working with repositories, compilers, and kernel modules. Despite the apparent complexity, the workflow here is strictly structured: hardware identification, finding the appropriate module, and activating it. Understanding these principles will allow you not only to solve the current problem but also to gain valuable experience in system administration.

In this article, we'll cover every step of connecting a wireless adapter, from basic diagnostics to manually compiling drivers for complex situations. We'll cover both wired and smartphone connection methods, as installing the first packages will require temporary internet access. Get ready to dive into the terminal, as the command line is the most powerful tool a Linux user can use.

Primary diagnostics and equipment identification

Before looking for a solution, it's important to understand exactly what hardware we're dealing with. The Linux operating system has powerful utilities for scanning the PCI and USB buses to which network cards are connected. Even if the driver isn't installed, the device's controller will be visible to the system, allowing us to determine its Vendor ID and Device ID. These identifiers are the key to finding the required software module.

To get started, open a terminal and enter the command lspci for internal cards or lsusb for external USB dongles. If the list is too long, filter by "Wireless" or "Network." You'll see a line containing the chipset name, for example, Realtek, Broadcom or Intel, as well as hexadecimal codes such as 8086:3165These figures are critical for further search.

⚠️ Attention: If the team lspci or lsusb If your device isn't visible at all, the adapter may be disabled in the BIOS/UEFI or physically faulty. Check the power saving settings and the Wi-Fi hardware switch on the laptop.

Additionally, it is worth using the utility lshw, which provides more detailed information about the hardware configuration. The command sudo lshw -C network will list all network interfaces with their status. If the field configuration you see driver= no name or UNCLAIMED, this confirms that the operating system sees the device, but does not have a control module for it.

📊 Which type of adapter isn't working for you?
Built into the laptop
USB whistle
PCI card for PC
Virtual machine

Preparing the system and obtaining Internet access

To install drivers from the repositories, you need an active internet connection. If Wi-Fi isn't working, a wired Ethernet connection is the most logical option. Simply connect the ISP cable to the port on your laptop or PC. Most modern distributions, such as Ubuntu, Linux Mint or Fedora, the wired Internet will work automatically thanks to the DHCP protocol.

In situations where a wired port is missing or not functioning, you can use your smartphone as a USB modem. Connect your phone to your computer via a cable, go to your mobile network settings, and enable "USB modem." The system will recognize the device as a new network card and provide access to the global network via your phone's mobile data or Wi-Fi. This temporary solution will allow you to download the necessary packages.

Once the connection is established, ensure that the proprietary driver repositories are enabled. On Debian/Ubuntu-based distributions, this can be done through the "Software and Updates" graphical interface or with a command in the terminal. It's also crucial to update your package lists so that the system knows about the latest driver versions.

sudo apt update

sudo apt upgrade

Running these commands ensures you're installing current software versions, which may contain bugs. Sometimes the problem is resolved at this stage, as the updated kernel may have added missing modules. If the internet still doesn't work after rebooting, proceed to manual search and installation.

☑️ Preparing to install drivers

Completed: 0 / 4

Automatic installation via driver manager

Many users prefer a graphical interface to the command line, and Linux distributions offer convenient tools for this. A driver manager is a utility that automatically scans your hardware, compares it against a database of known devices, and suggests installing recommended proprietary drivers. This is the easiest and safest option for beginners.

In Ubuntu and Mint, this tool is called "Additional Drivers." You can find it through the application menu or by running the command software-properties-gtk --open-tab=4 in the terminal. The system will search and, if it finds a suitable solution for your chipset, Broadcom or Realtek, will offer to activate it.

Select the recommended driver from the list and click "Apply Changes." The system will download the necessary files, install them, and prompt you to reboot. After the reboot, Wi-Fi should work automatically. This method is ideal for popular adapter models that have good community support.

Chip manufacturer Typical driver package Installation method Stability
Intel firmware-iwlwifi Automatic (core) High
Broadcom bcmwl-kernel-source Additional drivers Average
Realtek (old) rtl8192eu-dkms Repository / GitHub Depends on the version
MediaTek firmware-misc-nonfree Repository High

Manually installing drivers from repositories

If the automatic search yields no results, you'll have to do it manually using a package manager. Knowing the chipset name (obtained during the diagnostics step), you can find the corresponding package in the distribution's official repositories. For devices Realtek And Ralink Often, separate packages are required that are not installed by default.

First, you need to install the compiler and kernel headers, as many drivers are built dynamically. Packages build-essential, linux-headers-generic And dkms are required for successful module compilation. Without them, installing the driver from source or the DKMS package is impossible.

sudo apt install build-essential linux-headers-$(uname -r) dkms git

After preparing the environment, try searching for and installing the driver by name. For example, some Realtek cards use the package rtlwifi-new-dkmsEnter the installation command and wait for the process to complete. If the package manager reports that the package is not found, it's not in the standard repositories, and you'll need to search for the source code on GitHub or the manufacturer's website.

A common mistake is installing drivers without checking kernel module signatures if Secure Boot is enabled. The BIOS/UEFI may require disabling Secure Boot or signing the module with a Machine Owner Key (MOK). Ignoring this requirement will prevent even a properly installed driver from loading into the security system.

Compiling drivers from source code (GitHub)

For newer or rare adapters, such as some models Realtek RTL8812AU or MT7921, ready-made packages may not be available. In this case, the only option is to compile the driver from the source code, which can be found on GitHub. This process requires careful attention, but ensures the latest version of the software.

First, find a repository with a driver for your chipset. Make sure the project is maintained (has recent commits) and has installation instructions. Clone the repository to your computer, navigate to the created directory, and run the installation script. This is often the command make followed by sudo make install.

⚠️ Warning: Manually updating the Linux kernel may cause installed drivers to stop working. You'll need to recompile them for the new kernel version. Use the DKMS method, if available from the driver author, to automate this process.

Let's look at an example of installing a popular driver for Realtek chips. After cloning the repository and navigating to the folder, follow these steps. The system will automatically build the module and register it in the kernel.

git clone https://github.com/aircrack-ng/rtl8812au.git

cd rtl8812au

sudo make dkms_install

sudo modprobe 8812au

If compilation is successful, the terminal output will contain no error messages, only warnings, which can be ignored. After this, load the module with the command modprobe with the driver name. Check the interface status with the command ip link - a new interface should appear, usually wlan0.

What to do if make gives an error?

If a compilation error occurs, check that the kernel headers (linux-headers) are installed. This is often resolved by running sudo apt install linux-headers-$(uname -r). Also, make sure that the GCC (compiler) version is compatible with the kernel version.

Setting up and managing a wireless connection

After successful driver installation, the adapter should appear in the list of network devices. However, additional configuration may be required, especially if you're in a restricted region or using specific hardware. Wi-Fi management in Linux is performed using a utility. iwconfig (old) or more modern iw.

To check the status of the radio interface, use the command ip link showIf the interface is marked as DOWN, it needs to be raised by the command sudo ip link set wlan0 upIt is also useful to check whether Wi-Fi is blocked by software or hardware using a utility rfkill.

Team rfkill list all will show the status of all wireless devices. If you see the status Soft blocked: yes, unlock the device with the command rfkill unblock wifi. If the status Hard blocked: yes, this means that the switch is located on the laptop case or in the BIOS, and it cannot be bypassed programmatically.

To connect to hidden networks or set up a static IP address, it is better to use a graphical network manager (Network Manager) or utility nmtui, which operates in text mode but has a user-friendly menu. This will help avoid errors when manually editing configuration files.

Frequently Asked Questions (FAQ)

Why does the driver stop working after updating the Linux kernel?

When updating the kernel, older driver modules installed manually may become incompatible with the new version. To avoid this, use packages with DKMS (Dynamic Kernel Module Support). They automatically recompile the driver module with each kernel update, ensuring uninterrupted Wi-Fi operation.

How do I know which driver is currently being used for Wi-Fi?

Use the command lspci -k or lsusb -vIn the output, look for the line "Kernel driver in use." This will indicate the name of the active module. If this line is missing, the driver is not loaded or installed.

Can Windows drivers be used on Linux?

Directly, no. However, there is a project ndiswrapper, which allows you to run Windows drivers (.inf files) on Linux. This is a last resort, is unstable, and only works for older devices. For modern adapters, it's better to look for a native driver.

What to do if Wi-Fi is visible but won't connect?

Check that you've entered the correct password, the encryption type (WPA2/WPA3), and the time settings on your computer. Also, try disabling power saving for your wireless adapter by adding the appropriate line to the driver configuration file.