Installing a Linux operating system on a computer often faces the classic "chicken and egg" problem: Internet access requires working WiFi, and WiFi often requires drivers that cannot be downloaded without the internet. In the distribution Ubuntu Hardware support has improved significantly in recent years, but proprietary modules from Broadcom, Realtek, or MediaTek may still require manual activation. Users may find that the system boots up, but the wireless network icon in the upper right corner is missing or inactive.
The first step should always be diagnostics, not a haphazard attempt to install everything. It's important to understand the specific chipset installed in your adapter, as this determines the installation method you choose. There's no one-size-fits-all solution, as network equipment manufacturers use hundreds of different controllers, each requiring a different approach. In this article, we'll cover every step: from device detection to manually compiling the kernel module if automated tools prove ineffective.
It's important to understand that the process may require a temporary wired connection or using your smartphone in USB tethering mode. No access to repositories If you can't download DEB packages on another device, installing some drivers will be impossible. Therefore, prepare an Ethernet cable or make sure your Android smartphone supports USB internet sharing before using the terminal.
Identifying a network adapter and finding the vendor
Before looking for a solution, you need to know exactly what hardware you're dealing with. Standard graphics utilities often hide detailed information, so the most reliable method is to use the command line. Open a terminal and enter the command lspci for built-in modules or lsusb For external USB dongles. These utilities will list all connected devices with their IDs.
In the command output, you will see lines containing manufacturer names such as Realtek Semiconductor Co., Broadcom Inc. or Intel CorporationThe chipset model number will be listed next to it, for example, RTL8821CE or BCM43142. This combination of letters and numbers is the key to finding the correct driver. If you see "Network controller" without specifying the model, try adding the flag. -nn to the lspci command to see the vendor and device numeric codes.
For a more detailed analysis, you can use the utility lshw, which will show the driver loading status. Enter the command sudo lshw -C network and pay attention to the line driverIf it says "UNCLAIMED," the system sees the device but doesn't know how to use it. If the field is empty or the device isn't displayed at all, the adapter may be physically faulty or disabled in the BIOS.
Using additional Ubuntu drivers
The easiest and safest way to resolve this issue is to use the built-in driver management mechanism. Ubuntu has access to a database of proprietary modules that are not included in the main repository for licensing reasons, but are available for user installation. To access this feature, open the application menu and find the "Software & Updates" utility.
Go to the "Additional Drivers" tab. The system will scan your hardware and offer available options. If your adapter is a popular Broadcom or NVIDIA model (which sometimes includes WiFi modules), you'll see a list with radio buttons. Select the option labeled "proprietary" and click "Apply Changes."
The installation process will take a few minutes, after which a reboot will be required. This method is advantageous because the installed packages are signed and tested by the distribution's developers. However, if nothing appears in the list or the suggested driver doesn't work, you'll have to resort to more advanced manual installation methods using the package manager. apt.
⚠️ Attention: If the Additional Drivers tab is empty, make sure you have an active internet connection (via cable or USB modem), as the utility will not be able to download the list of available packages without a network.
Installing drivers via the APT package manager
Many modern drivers for Linux have already been ported and are available in the official Ubuntu repositories. To install them, you don't need to compile anything manually. First, update your package lists with the command sudo apt update. Then you can try installing universal driver sets. For example, for Broadcom devices, the package bcmwl-kernel-source, and for many Realtek and MediaTek chips there are packages with the prefix firmware-.
You can search for the required package using the command apt search. Enter part of the chipset name, for example apt search rtl8821, and the system will display available packages. If you find a suitable one, install it with the command sudo apt install package-nameAfter installation, the module should automatically load on the next reboot or after running the command modprobe.
The table below lists common chipsets and their corresponding packages that often resolve the issue:
| Chipset / Vendor | Ubuntu package | Driver type |
|---|---|---|
| Broadcom BCM43xx | bcmwl-kernel-source | Proprietary |
| Realtek RTL8821CE | rtl8821ce-dkms | DKMS (Open Source) |
| MediaTek MT7921 | firmware-misc-nonfree | Firmware |
| Intel WiFi 6 | firmware-iwlwifi | Open (in core) |
If the installation was successful, but WiFi still does not appear, check the module status. Enter lsmod | grep module_nameIf the output is empty, try loading the module manually: sudo modprobe module_nameBoot errors usually indicate a kernel version conflict or a missing module signature.
☑️ Checking driver installation
Manual compilation via DKMS for new devices
Owners of new laptops often encounter a situation where the Ubuntu repositories don't yet have a ready-made package for their latest WiFi adapter. In this case, technology comes to the rescue. DKMS (Dynamic Kernel Module Support). It allows you to compile a driver from source code specifically for your current kernel version and automatically recompile it when you update your system.
First, you need to install the compilation tools and the DKMS system itself. Run the command sudo apt install dkms build-essential gitNext, you need to find the driver source code. Such projects are most often hosted on GitHub. For example, for the popular RTL8821CE chip, you can use the repository tomaspinho/rtl8821ceClone the repository with the command git clone repository_address.
Go to the folder with the downloaded code. There you'll usually find an installation script called install.sh or dkms-install.shRun it with superuser rights: sudo./install.shThe script will automatically register the module in DKMS, compile it, and sign it (if necessary). Be sure to restart your computer after completing the process.
⚠️ Attention: When compiling third-party drivers, you assume responsibility for system stability. Make sure the GitHub repository has a high rating and recent commits confirming support for your kernel version.
Sometimes, errors related to missing kernel headers may occur during compilation. If the script complains about missing headers, install the package linux-headers-$(uname -r)This is a critical component for building any kernel modules. Without it, compilation is fundamentally impossible.
What should I do if compilation fails with an error?
Carefully examine the last lines of the output. The error is often related to kernel API changes in newer Ubuntu versions. Search the Issues section of the project's GitHub page for the word "error" or your kernel version number. The author may have already released a patch that you simply need to re-download via git pull.
Disabling Secure Boot in BIOS/UEFI
One of the most common reasons why an installed driver refuses to work is a security feature. Secure BootThis technology, implemented by Microsoft and motherboard manufacturers, prevents the loading of any kernel drivers that are not digitally signed with a trusted key. Since drivers installed manually or via DKMS are often not signed with an Ubuntu key, the system blocks their loading.
To check the status of Secure Boot, enter the command in the terminal mokutil --sb-stateIf you see the message "SecureBoot enabled," this means security is active. The easiest way to fix this is to disable this feature in the BIOS. Restart your computer, enter the BIOS/UEFI (usually press F2, Del, or F12 at startup), and find the Security or Boot section.
Find the item Secure Boot and switch it to position DisabledSave the settings and exit. After the system boots, the driver should work. If disabling Secure Boot is not possible due to corporate rules or other reasons, you can register a Machine Owner Key (MOK) using the utility. mokutil, but it is a more complicated process and requires entering a password at boot.
⚠️ Attention: Disabling Secure Boot reduces the system's protection against bootkits and rootkits. Only do this if you are confident in the security of your physical environment and the source of the drivers you are installing.
Diagnosing and resolving connection problems
Even after successful driver installation, connection stability issues or network visibility may persist. First, check to see if the radio interface is blocked by software. rfkill list will show the status of all wireless devices. If you see "Soft blocked: yes," unlock the device with the command sudo rfkill unblock wifi.
A common issue is a power management conflict. The driver may be too aggressive in shutting down the adapter to save battery power, leading to disconnects. To disable this feature, create a configuration file. Enter sudo nano /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf and change the value wifi.powersave on 2 (which means turning off savings).
It's also worth checking the system logs for WiFi-related errors. Command dmesg | grep -i firmware or dmesg | grep -i wlan will display kernel messages when attempting to load the driver. Red lines with the text "failed" or "error" will indicate the specific problem, whether it's a firmware issue or a syntax error in the configuration.
In some cases, resetting the network manager settings helps. Delete the connection configuration files in the folder /etc/NetworkManager/system-connections/ (after making a backup) and restart the service with the command sudo systemctl restart NetworkManagerThis will clear potentially conflicting settings from old profiles.
Frequently Asked Questions (FAQ)
Why does WiFi work but is very slow after installing the driver?
Speed may drop due to incorrect region or channel selection. Make sure your router settings match your region and use the 20/40/80 MHz channel width supported by your adapter. Also, check if the adapter has switched to 2.4 GHz instead of 5 GHz.
Is it possible to install the driver without the Internet at all?
Yes, but you'll need another device with internet access. Download the necessary deb packages and their dependencies (deb archives) on another computer, transfer them to a USB flash drive, and install them in Ubuntu using the terminal command. sudo dpkg -i package.debBe mindful of dependencies.
How can I get everything back if the driver broke the system?
If you used DKMS, remove the module with the command sudo dkms remove module_name/versionIf you installed it via apt, use sudo apt remove package_nameIf the problem is with Secure Boot, simply enable it back in the BIOS, and the unsigned driver will no longer load.
Do USB WiFi adapters work with Android via OTG in Ubuntu?
In theory, yes, if the kernel supports your chipset and USB OTG support is enabled. However, in practice, this is unstable due to insufficient power from the USB port and the lack of specific drivers in the Android mobile kernel used in host mode.