Installing WiFi Drivers on Linux: A Complete Guide

Installing a Linux operating system is often the first step toward a more secure and free computing experience, but this process can be hindered by a lack of network access. A situation where, after installing a distribution, you discover that wireless module The problem doesn't work, which is common, especially on laptops with the latest or, conversely, very specific hardware. The lack of internet access blocks the ability to download the necessary packages, creating a vicious circle that's difficult for beginners to escape without the help of an experienced user.

The solution lies in correctly identifying the hardware and then manually installing the software that ensures communication between the operating system and the network card. Unlike proprietary systems, where manufacturers often provide ready-made installers, in the open source world, you'll have to select and implement the necessary software yourself. kernel moduleThis requires attention, but the results are worth it: stable network operation and complete control over the configuration.

In this article, we'll detail the steps you need to take to get Wi-Fi up and running even in the most challenging situations. We'll cover automatic detection methods, manual compilation from source code, and working with proprietary firmware files. It is critically important to have an alternative internet connection, such as a USB modem or wired Ethernet connection, before starting any action. Without this step, further manipulations will not be possible, since the package repositories are located online.

Network adapter identification

The first and most important step is to accurately identify the model of your network controller. Linux can handle a huge number of devices, but to function correctly, it needs to know the exact hardware ID. To do this, open a terminal and enter the command lspci for built-in maps or lsusb For external USB dongles. These utilities will list all connected devices, where you need to find lines with the words Network controller, Wireless or names of popular manufacturers such as Realtek, Broadcom, Intel.

Particular attention should be paid to the vendor and device codes, which look like 8086:3165 or 0bda:8822The first digit indicates the manufacturer, and the second indicates the specific chip model. This information is necessary for searching for the corresponding driver in databases or on the manufacturer's website. If standard commands don't provide detailed information, you can use a utility inxi, which often provides more readable output and driver status information.

⚠️ Note: Some modern adapters may not be detected by the system if they are in power-saving mode or locked by the BIOS. Before troubleshooting, ensure the WiFi module is enabled in the BIOS/UEFI and "Airplane Mode" is disabled at the hardware level.

Once you receive the ID, write it down or copy it to the clipboard. This is the key to finding a solution. It often happens that the chipset is detected, but the system marks it as "unclaimed," which means there is no loaded kernel module. In this case, we need to find the name of the module compatible with your ID. For USB devices, the command output is also useful. dmesg | grep usb immediately after connecting the adapter to see kernel messages about errors or successful initialization.

📊 What type of WiFi adapter do you have?
Built into the laptop
USB whistle
PCI-E card for PC
External antenna

Automatic installation via repositories

The easiest and safest way to resolve this issue is to use the distribution's built-in mechanisms. Most modern distributions, such as Ubuntu, Linux Mint, Fedora, or Manjaro, have extensive repositories with pre-compiled and tested drivers for popular hardware. If you have a wired internet connection, the first step is to check for additional drivers using the graphical interface or terminal.

Debian and Ubuntu based distributions have a utility ubuntu-drivers, which automatically scans your hardware and offers to install recommended proprietary modules. Run the command sudo ubuntu-drivers autoinstall can instantly resolve the issue if your adapter is supported but requires proprietary firmware. A similar mechanism is available in Linux Mint in the "Driver Manager" section, where you can select the required driver version from the list.

If the automatic search doesn't yield any results, you can try installing firmware packages manually. Often, the problem lies not in the driver itself being missing from the kernel, but in the missing microcode. These packages are usually called firmware-realtek, firmware-brcm80211 or firmware-iwlwifi Depending on the chip manufacturer, installation is performed through a package manager, for example, apt or dnf.

☑️ Checking automatic installation

Completed: 0 / 5

After installing packages, a reboot or at least re-enablement of the kernel module is often required. Don't skip this step, as new firmware files are loaded only when the corresponding service or system starts. If WiFi doesn't work after installing the packages, check the system logs for module loading errors. This will help you determine whether the installed driver is compatible with your device revision or whether a more recent kernel version is required.

Manual installation of Realtek drivers

Realtek adapters often cause problems for Linux users, as the manufacturer doesn't always provide official open-source drivers to the main kernel branch immediately after the device's release. In such cases, the only solution is to find and compile the driver from the source code, which can be found on GitHub or the manufacturer's official website. This process requires installing a compiler. gcc and kernel header files linux-headers.

The installation process typically follows the standard sequence of commands for compiling programs on Unix-like systems. First, you need to clone the driver code repository, then navigate to the directory, and run the build script. This often looks like this: make, sudo make install And sudo modprobe to enable the module. It's important to strictly follow the instructions in the README file for a specific repository, as the steps may vary.

Chip model Firmware package Kernel module Support status
RTL8821CE firmware-realtek rtw_8821ce Requires assembly
RTL8723DE firmware-realtek rtl8723de In kernel 5.4+
RTL8812AU - 8812au Third-party driver
RTL8192EU firmware-realtek 8192eu Stable

When compiling drivers from source, it's important to consider your kernel version. A driver written for kernel 5.10 may fail to build or be unstable on kernel 6.5 due to changes in internal APIs. If you're using a distribution with a very new or older kernel version, look for driver forks marked "patched for kernel."

What should I do if compilation fails?

If you see errors when running the make command, check that the required build packages (build-essential, linux-headers) are installed. The error may also be caused by a mismatch between the compiler and kernel versions. Try searching the issues repository for similar errors—there's often a solution or patch available.

Working with proprietary Broadcom modules

Broadcom chipsets have historically had complex Linux support, unlike Intel, which actively develops open-source drivers. iwlwifiBroadcom has long relied on a proprietary driver wlIn modern distributions, this driver is usually available as a DKMS module, which allows it to be automatically rebuilt when the kernel is updated, ensuring uninterrupted network operation.

To install the Broadcom driver in Ubuntu and Mint, the package is often sufficient. bcmwl-kernel-sourceHowever, if open source drivers were previously installed on the system bcma or b43, they may conflict with a proprietary module. In this case, you must first remove or disable the loading of open modules by creating a configuration file in /etc/modprobe.d/ with the directive blacklistThis will prevent the kernel from attempting to use an inappropriate driver.

Older Broadcom models are a special case, as they require downloading firmware separately from the driver. The firmware files must be located in the following directory: /lib/firmware. If after installing the driver in the logs (dmesg) you see messages that the firmware is not found, you will have to manually download the binary blob from the vendor's website or from the repository linux-firmware-nonfree and place it in the desired folder, respecting access rights.

⚠️ Warning: Using proprietary Broadcom drivers on newer kernels (6.x and higher) may cause compatibility issues. Always check the compatibility of the bcmwl-kernel-source package version with your kernel version before updating your system.

Setting up WiFi power management

Even after successfully installing the driver, users may experience intermittent connection drops or low data transfer speeds. This behavior is often caused by an aggressive power-saving policy built into the driver or kernel settings. The system attempts to conserve battery power by temporarily shutting down the adapter or reducing its power, which destabilizes the connection.

To disable power saving for WiFi, you can create a configuration file. For example, creating a file works for many drivers. /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf with content setting the parameter wifi.powersave in meaning 2 (which means disabling power saving). Some Realtek drivers may require passing parameters when loading the module, for example, options rtl8723be fwlps=0 ips=0.

You can check the current power management status using the command iwconfig or driver-specific utilities. If you notice that the adapter is constantly going into sleep mode and then taking a long time to reconnect, disabling these features is a priority. This is especially true for desktop PCs, where power saving isn't a concern, but link stability is.

Diagnostics and problem solving

If the driver installation is successful but WiFi still doesn't work, you need to run a thorough diagnostic. The first tool to use is the utility nmcli (NetworkManager command line interface), which allows you to manage connections and view their status. The command nmcli radio wifi will show whether the radio module is on, and nmcli dev wifi list will display available networks. If the list is empty, the driver may be unable to scan the airwaves due to firmware errors.

Kernel logs are your best friend when it comes to finding the cause of a crash. Command dmesg | grep -i wifi or dmesg | grep -i firmware will display all wireless network-related messages. Look for lines with the words "error," "fail," "timeout," or "disassociate." These often reveal a specific cause: an incorrect API version, a missing firmware file, or an IRQ conflict. Deciphering these errors requires careful attention, but often provides a direct answer to the question "why?"

It's also worth checking whether a firewall or IPv6 settings are blocking the connection. In rare cases, disabling IPv6 in NetworkManager settings can improve connection stability on older routers. Remember that after any changes to configuration files, you must restart the network service with the command sudo systemctl restart NetworkManager or reboot the entire computer.

Why did WiFi stop working after updating the kernel?

Updating the Linux kernel often changes the internal structures that drivers interact with. If you used a third-party driver (for example, for Realtek), it might not be updated automatically with the kernel. You'll need to rerun the module compilation and installation process for the new kernel version. Using DKMS (Dynamic Kernel Module Support) helps automate this process by rebuilding modules with each update.

Can Windows drivers be used on Linux?

Directly running .exe or .sys files in Linux is not possible. However, the NDISwrapper project allows you to use Windows drivers (.inf and .sys files) in Linux. This is a complex and unstable solution, considered a workaround and recommended only as a last resort when a native driver does not exist. Modern Linux kernels have excellent hardware support, and the need for NDISwrapper is extremely rare.

How do I know which driver is currently being used?

Use the command lspci -k (for PCI devices) or lsusb -v (for USB). In the command output, look for the line "Kernel driver in use." This line will indicate the name of the active kernel module (e.g., iwlwifi, ath9k, rtw_8822ce). If this line is missing, the driver for the device is not loaded.