Installing Wi-Fi Drivers on Linux: From Finding the Chip to a Stable Connection

Working with Linux operating systems often requires a deeper understanding of technical details than with familiar Windows or macOS. One of the most common obstacles newcomers face when switching to open source software is the lack of internet access immediately after installing the system. This is a classic "chicken and egg problem": downloading the necessary packages and drivers requires network access, and network access usually requires drivers that haven't yet been installed.

The situation is complicated by the fact that hardware manufacturers rarely develop native drivers for Linux, relying instead on the enthusiast community. However, modern distributions have powerful automatic hardware detection mechanisms. Linux kernel already contains a huge database of open-source drivers, but proprietary components for some chipsets may not be included in the default package. Understanding how the wireless network subsystem works will allow you to quickly resolve connection issues.

In this guide, we'll explore not just a set of commands, but the logic behind the device identification process and the selection of appropriate software. You'll learn to distinguish between situations where a driver is already present in the system but disabled, and cases where manual compilation of modules is required. Competent diagnostics At the initial stage, it will save you hours of pointless attempts to install incompatible packages.

⚠️ Note: Package manager and repository interfaces may differ depending on the distribution version (Ubuntu, Debian, Fedora, Arch). Always check that the commands are up-to-date for your specific system build.

Identifying a wireless adapter

The first and most critical step is to accurately identify your network adapter model and, more importantly, the chipset it's based on. Manufacturers may use the same model names for devices with different internals, so you need to rely on the hardware identifiers. There's a Linux utility for this. lspci for internal cards or lsusb for external USB whistles.

Launch the terminal and enter the command lspci -nn | grep -i network or lsusbIn the output, you will see lines with vendor and device identifiers in the format [xxxx:xxxx]For example, the entry Realtek Semiconductor Co., Ltd. RTL8821CE indicates a specific chipset that requires a separate kernel module. This information will be the key to finding the correct driver in the repositories or on GitHub.

It is often useful to know which driver (kernel module) the system is already trying to use, even if it is not running. The command lspci -k will show the line Kernel driver in use or Kernel modules. If the modules line indicates rtl8821ce, but the driver is not loaded, perhaps the problem is a version conflict or missing firmware. Chipset identification - this is the foundation without which further actions are meaningless.

📊 What type of Wi-Fi adapter are you using?
Built-in (PCIe/Mini PCIe)
External USB
Built into the motherboard (laptop)
I don't know / I can't determine

In some cases, the system may see a device but not know how to use it, marking it as "Unclaimed." This indicates that the kernel has detected the hardware, but the corresponding module is not loaded or missing. For USB adapters, it's also helpful to check the command output. dmesg | tail immediately after connecting the device to see messages about firmware download errors.

Using built-in tools and repositories

Modern Linux distributions such as Ubuntu, Linux Mint, and Fedora offer convenient graphical interfaces for managing additional drivers. This is the safest and easiest way for novice users, as the system automatically selects compatible software versions. In Ubuntu, this tool is called "Additional Drivers," and in Fedora, it's integrated into the software settings.

If the graphical interface is unavailable or doesn't show any results, you can use the command line. On Debian/Ubuntu-based distributions, the utility ubuntu-drivers allows you to scan the system and offer installation of recommended packages. The command sudo ubuntu-drivers autoinstall will automatically install all found proprietary drivers, including those required for Wi-Fi.

  • 📦 Check for firmware packages: installing the package often solves the problem linux-firmware or firmware-misc-nonfree.
  • 🔄 Update package lists with the command sudo apt update before searching for drivers to get access to the latest versions.
  • 🔍 Use a search for chipset keywords, for example apt search rtl8821to find specific packages.

It's important to understand the difference between open-source drivers and proprietary components. Open-source drivers are already built into the kernel and typically don't require separate installation, only firmware. Proprietary drivers (such as Broadcom STA) require the installation of separate packages, which may not be included in the default repository due to licensing restrictions.

⚠️ Important: When installing drivers from third-party repositories (PPA), make sure they match your distribution version. Version mismatches may result in system instability or failure to boot.

Manual installation via DKMS and compilation

When ready-made packages are unavailable, the only solution is to manually build the driver from source code. This is done using a framework DKMS (Dynamic Kernel Module Support), which enables on-the-fly compilation of kernel modules and automatic rebuilding when the system kernel is updated. This is the industry standard for installing Wi-Fi drivers in Linux.

The process begins with installing development tools. You'll need the following packages: build-essential, dkms, git and kernel header files (linux-headers-generic). Without header files, module compilation is impossible, as the compiler needs to know the internal structure of the kernel. Make sure the header version exactly matches the version of the running kernel.

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

Once the environment is prepared, you need to find a driver repository. This is usually a community-supported GitHub project. For example, popular Realtek chips often use the repository rtl88x2bu or similar. Clone the repository, navigate to the folder, and run the installation script, which is usually called install.sh or dkms-install.sh.

☑️ Checklist before compiling the driver

Completed: 0 / 4

Compilation errors may occur due to changes in the kernel API. Driver developers sometimes fail to update their code for new Linux versions. In such cases, it's worth looking for "forks" of the project where other users have already fixed compatibility issues. Careful reading of the error log When compiling, it often gives you a hint as to which file or function is causing the problem.

Working with firmware

Often, the driver itself is present in the system, but the device fails to boot due to a missing firmware file. Firmware is a binary file that is loaded into the device's memory during initialization. In Linux, these files are typically stored in the directory /lib/firmware. If during system boot in the logs (dmesg) you see the message “firmware not found”, which means you need to manually find and place the required file.

Firmware files are often distributed as part of a package linux-firmware, but for rare devices, you have to search for them separately. You should search by the file code name specified in the error. dmesg, For example rtl8821ce_fw.binAfter downloading, the file must be placed in a directory. /lib/firmware while maintaining the folder structure, if required.

Error type Probable cause Solution
Direct firmware load failed The firmware file is missing Download the .bin file and place it in /lib/firmware
Module not found The driver is not compiled Install via DKMS or package manager
Invalid module format Kernel version mismatch Recompile the module for the current kernel

After adding the firmware, you need to reboot the kernel module or the entire system. The command sudo modprobe -r module_name unload the driver, and sudo modprobe module_name will reload it, forcing the system to try reading the firmware again. This is faster than a full reboot of the computer.

Where can I find firmware if it's not in the official repositories?

The official linux-firmware repository on kernel.org, Git repositories of manufacturers (for example, Qualcomm Atheros), as well as specialized forums like forum.manjaro.org or archlinux.org, where users share extracted binaries.

Kernel module management and blacklisting

Sometimes there's a conflicting driver in the system that takes over the device before the module you need. For example, an open driver ath9k may conflict with proprietary wl For Broadcom. In such cases, it's necessary to prevent the unnecessary module from loading by adding it to the blacklist.

To do this, create a configuration file in the directory /etc/modprobe.d/, For example blacklist.conf. Add the line there. blacklist conflicting_module_name. It is also useful to add the line install module_name /bin/falseto ensure that the module will not load under any circumstances. Kernel modules — This is a low-level component, and errors here can lead to network inoperability.

After changing the module configuration, be sure to run the command sudo update-initramfs -u (for Debian/Ubuntu) or sudo dracut -f (for Fedora/Arch). These commands update the boot image (initramfs), where the blacklisted changes are applied. Without this step, the system may load a conflicting driver before the settings from /etc/modprobe.d/.

⚠️ Warning: Be careful when blacklisting modules. Incorrectly blocking a critical system module can cause problems with booting or operating peripherals.

Diagnostics and troubleshooting

If Wi-Fi still doesn't work after all these steps, we'll move on to a deeper diagnostic. First, check the network interface status with the command ip link or ifconfigIf the interface is in the state DOWN, try to raise it with the command sudo ip link set wlan0 up (replacing wlan0 to the name of your interface).

Utility nmcli (NetworkManager command line interface) provides powerful tools for analysis. The command nmcli device status will show the general status of the devices, and nmcli device wifi list will display a list of available networks. If the list is empty, the radio module may be blocked. Check the blocking status with the command rfkill list allIf you see “Soft blocked: yes,” unblock it with the command rfkill unblock wifi.

  • 📡 Check your region: some drivers require you to set the correct region (country code) via iw reg set RU to access certain channels.
  • 🔌 USB ports: For USB adapters, try switching the device to a USB 2.0 port, as some older drivers do not work reliably with USB 3.0.
  • 🛡️ Secure Boot: Secure Boot may be enabled in your BIOS/UEFI, which prevents unsigned drivers (DKMS modules) from loading. Try temporarily disabling it.

System logs are your greatest ally. Team journalctl -f Allows you to monitor system events in real time. Connect the adapter or try enabling Wi-Fi and monitor any error messages that appear. These often contain a direct indication of the cause of the failure, such as a timeout waiting for a response from the device.

Frequently Asked Questions (FAQ)

How do I know which driver is needed for my Wi-Fi adapter?

Use commands lspci -nn or lsusb To obtain the device identifier (Vendor ID and Device ID), enter these codes into a search engine along with the word "Linux driver" or use linux-hardware.org, which automatically detects your hardware and suggests the necessary modules.

Is it safe to disable Secure Boot to install drivers?

For a home computer, this is generally safe. Secure Boot protects against bootable rootkits, but requires all kernel modules to be digitally signed. Since drivers manually compiled via DKMS are not signed by Microsoft, the system blocks them from loading. Disabling Secure Boot solves this problem.

Does Wi-Fi disappear after updating the Linux kernel?

If you used DKMS to install the driver, it should automatically rebuild for the new kernel during the update. If you installed the driver manually without DKMS, Wi-Fi will stop working after the kernel update, and you'll have to repeat the installation process.

Where can I find a driver if my card is not supported in Linux?

If the chipset is brand new or very rare, there may be no support. Try searching GitHub for the chip name. If there's nothing there, you can only rely on the community or use an adapter in USB tethering mode from an Android smartphone to access the internet and find a solution.