Installing Wi-Fi Adapter Drivers in Linux: From Beginner to Pro

Linux-based operating systems are renowned for their stability and security, but compatibility with wireless network interfaces often becomes a stumbling block for beginners. Unlike Windows, where drivers are often integrated into the installation image or downloaded automatically, in the open source world, users sometimes have to manually search for and compile the necessary modules. This is especially true for owners of modern laptops or specialized USB adapters, whose manufacturers are slow to provide support for their distributions.

The situation with no internet connection is a classic "chicken and egg" problem: you need internet access to download a driver, but you need a driver to connect to the internet. Fortunately, there are many workarounds, including using your smartphone as a USB modem or downloading packages on another device. Understanding the architecture Linux kernels and the operating principles of the modules will allow you to not just blindly follow the instructions, but to understand each step, which is critical when working with system files.

In this guide, we'll cover every step: from accurately identifying your device's chipset to manually compiling modules from source code if the repositories don't contain a ready-made solution. We'll cover methods for the most popular distributions, such as Ubuntu, Debian, Fedora, and Arch, with a special focus on terminal commands. Even if you've never opened a console, our step-by-step explanations will help you restore your wireless connection and enjoy the freedom of open source software.

Identifying the wireless adapter and chipset

Before searching for and installing software, you need to accurately determine the model of your network controller. Laptop manufacturers often use the same model names for devices with completely different internals, so you need to rely on the hardware IDs. To obtain this information, there are several powerful Linux utilities that display comprehensive data on connected devices.

The most universal tool is the team lspci for internal cards and lsusb For external USB dongles. Running them in a terminal will list all connected devices. To filter out unnecessary information, use a pipeline with the grep command, for example: lspci | grep -i network or lsusbIn the output, you will see lines like "Realtek Semiconductor Co., Ltd. RTL8821CE", where RTL8821CE is the chipset you are looking for.

If standard utilities do not provide a complete answer, you can use a more detailed tool lshw, which displays technical information about the hardware. Team sudo lshw -C network will give a detailed report, including the driver status (if loaded) and the current interface state. Note the line configuration, where the driver name may be indicated even if it does not work correctly.

⚠️ Attention: When copying device identifiers (Vendor ID and Product ID), be extremely careful. One incorrect digit can result in the installation of an incompatible module, which will cause a system conflict or even prevent the kernel from loading.

Knowing the exact chipset model is 90% of the solution. This is the code you'll use to search for the corresponding package in the repositories or the source code on GitHub. Don't rely on the laptop model name; always check the hardware using software, as the same laptop model may have different Wi-Fi modules.

📊 What type of Wi-Fi adapter do you have?
Built into the laptop (PCIe)
External USB whistle
Internal M.2 (Mini PCIe) card
I don't know, I need to check.

Checking for drivers in repositories

Modern Linux distributions such as Ubuntu, Linux Mint, Fedora, and Manjaro have extensive repositories containing drivers for most popular devices. Often, the problem can be solved by simply searching for and installing the package through the package manager, without the need for manual compilation. This is the safest and preferred method, as packages in the repositories undergo compatibility testing.

For Debian and Ubuntu based distributions, use the command apt or apt-getFirst, update the package lists with the command sudo apt update, and then find the driver by the chipset name. For example, apt search rtl8821 can issue a package firmware-realtek or a specific module dkmsInstallation is performed by the command sudo apt install package_name.

In the Red Hat world (CentOS, Fedora) the manager is used dnf or yum. The search logic is similar: dnf search wifi or dnf search firmwareRepository connection is often required. RPM Fusion, which contains proprietary firmware and drivers not included in the main distribution for licensing reasons. After enabling the repository, installation proceeds as usual.

There is also a utility ubuntu-drivers (available in Ubuntu and derivatives), which automatically scans your hardware and offers to install recommended drivers. Running the command sudo ubuntu-drivers autoinstall can instantly solve the problem by selecting the optimal module version for your kernel. This is a great option for those who don't want to delve into the details of package versions.

Using additional drivers and DKMS

Technology DKMS (Dynamic Kernel Module Support) is a lifesaver for Linux users who frequently update their kernel. It automatically recompiles third-party modules (drivers) every time the kernel is updated, ensuring Wi-Fi remains functional. Without DKMS, you would have to manually reinstall the driver after every system upgrade, which is extremely inconvenient.

Many distributions include a graphical utility called "Additional Drivers." In Ubuntu, you can find it through the application search or in System Settings. This tool scans your hardware and suggests installing proprietary drivers that aren't included in the standard distribution. Selecting the one marked "recommended" is usually the safest bet for stable operation.

If there is no graphical interface, you can manage DKMS via the console. First, make sure the packages dkms, build-essential and kernel headers (linux-headers-generic) are installed. Then the driver is installed using the command sudo dkms install module_name/versionThe status of installed modules is checked by the command dkms status, which will show for which kernels the module was successfully built.

Distribution Package manager Search team Firmware repository
Ubuntu / Debian apt apt search firmware non-free / multiverse
Fedora dnf dnf search linux-firmware RPM Fusion
Arch Linux pacman pacman -Ss firmware AUR / extra
openSUSE zypper zypper search firmware Packman

It's important to understand the difference between firmware and a driver. Firmware is a binary file loaded onto a device, while a driver is a kernel module that controls the device. Often, a package needs to be installed for Wi-Fi to work. linux-firmware, which contains firmware databases for thousands of devices. The absence of this package is a common cause of an adapter not working, even with a driver.

☑️ Pre-installation check

Completed: 0 / 4

Manually installing drivers from source code

When ready-made packages are unavailable or don't work, you have to resort to manual compilation from source code. This is a more complex approach, requiring a compiler and build tools. You'll need packages. build-essential (for Debian/Ubuntu) or base-devel (for Arch), as well as kernel headers appropriate for your current Linux version.

The process usually begins with cloning a repository from GitHub or downloading an archive from the manufacturer's website. After unzipping the files, navigate to the directory and run the standard three commands: make (compilation), sudo make install (installing files into the system) and sudo modprobe module_name (module loading). Sometimes between make And install cleaning of old files is required with the command make clean.

Secure Boot should be given special attention. If Secure Boot is enabled in the BIOS, it may block the loading of custom kernel modules, as they are not digitally signed. In this case, either disable Secure Boot in the BIOS or sign the module with a Machine Owner Key (MOK), which is a more secure but more complex method.

⚠️ Attention: When compiling from source, always check which kernel version the driver is written for. A driver written for kernel 5.4 may fail to compile or cause a kernel panic on version 6.5 due to API changes.

After successful installation, do not forget to add the module name to the file /etc/modulesso that it loads automatically at system startup. This will save you from having to manually enter commands after each reboot. If the module conflicts with an existing one (for example, an open source driver) rtl8xxxu against proprietary rtl8821cu), blacklisting the old driver may be required.

Network setup and connection management

After installing the driver, the adapter should appear in the system, but this does not always mean automatic connection. Linux has several levels of network management: low-level wpa_supplicant, demon NetworkManager and command line utilities like nmcli or iwctlFor desktop users, NetworkManager, which has graphical applets, is the most convenient.

For diagnostics use the command ip link or iwconfigIf you see your interface (usually wlan0 or wlp2s0) in the state DOWN, it needs to be raised by the command sudo ip link set wlan0 upTo scan available networks, use nmcli dev wifi list, and for connection - nmcli dev wifi connect "SSID" password "password".

In server versions of Linux without a graphical shell, it is often used netplan (in Ubuntu) or wicdConfiguration in netplan is carried out through YAML files in the directory /etc/netplan/Indentation errors in the YAML file will prevent the network from working, so be careful when editing the configs.

What to do if the interface does not appear?

If the interface doesn't appear in the 'ip link' output after installing the driver, try reloading the module with 'sudo modprobe -r module_name' and then 'sudo modprobe module_name'. If that doesn't help, check dmesg for initialization errors.

Don't forget about power saving management. Some Wi-Fi drivers enable power saving mode by default, which can lead to unstable connections or disconnects. You can disable this mode through the NetworkManager configuration or by creating a rules file for a specific module and adding the line options module_name power_save=0.

Solving common problems and conflicts

Even with proper installation, conflicts may arise between multiple drivers claiming to control the same device. For example, open-source drivers often conflict with proprietary ones. This can be resolved by creating a blacklist file in the directory. /etc/modprobe.d/. Create a file, for example, blacklist.conf, and write the line there blacklist conflicting_driver_name.

A common issue is incorrect regional settings. If the driver is loaded but doesn't detect networks or is operating with limited power, check the region. sudo iw reg set RU (or your country code) can open up additional channels and improve signal strength. Make sure the country code matches your location's legal requirements.

DHCP issues can also masquerade as driver problems. If you're connected to an access point but aren't receiving an IP address, try restarting the network service or manually requesting an address via dhclient. System logs (/var/log/syslog or journalctl -u NetworkManager) contain invaluable information for diagnosing such cases.

⚠️ Attention: Command line interfaces and package names may change with the release of new distribution versions. Always consult your distribution's official documentation if the standard commands don't work.

If all else fails, try rolling back kernel updates. New Linux kernel versions sometimes break compatibility with older Wi-Fi drivers. Booting the previous kernel version via GRUB can help you determine whether the issue is related to the system update. In this case, you should wait for a driver update or use the LTS kernel version.

Why doesn't Wi-Fi work after updating Linux?

This most often occurs due to a kernel update. Third-party drivers, installed manually or via DKMS, must be rebuilt for the new kernel version. If DKMS fails or the module is incompatible with the new kernel API, the device will stop functioning. Solution: Load the old kernel or find updated driver source code.

How do I know if a driver is proprietary or open source?

Use the command lsmod and look at the module name. Usually, open-source drivers have names like ath9k, iwlwifi, rtl8xxxuProprietary ones often contain in the name _sta, _dkms or have specific prefixes (for example, wl for Broadcom). Also the team modinfo module_name will show the license in the field license (GPL vs proprietary).

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, used only for very old or exotic devices, as the stability and performance of ndiswrapper often leave much to be desired.