Linux operating systems are renowned for their flexibility and ability to work with a wide range of hardware out of the box. However, this very feature often becomes a source of problems when built-in autodetection mechanisms select the wrong kernel module for your network adapter. The situation when the system attempts to use the standard open-source Using a proprietary driver instead of a proprietary one, or vice versa, results in unstable wireless connections, frequent disconnections, or a complete lack of network connectivity.
You may need it completely Uninstall the WiFi driverTo clean the system of conflicting packages before installing a new version or switching to an alternative solution, uninstalling Linux is fundamentally different from the usual steps in Windows, where simply opening the Device Manager is sufficient. Here, we work directly with kernel modules and package managers, which requires attention to detail and an understanding of the distribution's structure.
Network stack malfunctions are often disguised as hardware issues, although the root cause is software. Before resorting to physical repairs or replacing the adapter, it's worth trying software solutions. In this article, we'll discuss how to safely identify, disable, and remove unnecessary driver components to restore your network stability.
Identifying the active network module
The first and most critical step is to accurately determine which driver is currently controlling your WiFi adapter. In Linux, hardware operation is controlled by kernel modules that are dynamically loaded upon system startup or device connection. To obtain detailed information about connected network interfaces and the drivers they use, use the utility lspci for internal cards or lsusb for external USB whistles.
Run the command lspci -k in the terminal to see a list of devices and their associated kernel drivers. In the output, you'll find the line "Kernel driver in use," which indicates the active module, for example, iwlwifi or rtl8821ceWe'll need this name for further manipulations. It's also useful to check the status of the modules using the command lsmod | grep wifito see loaded modules that contain the word wifi in their name.
Sometimes the system may load multiple modules for a single device, creating hidden resource conflicts. In this case, a simple reboot isn't enough; manual dependency analysis is required. Use the utility modinfo with the module name to find the path to the file on disk and its version. This will help you determine whether the driver is part of the kernel or installed separately.
How to distinguish a built-in driver from a third-party one?
Built-in kernel modules are typically located in the /lib/modules/$(uname -r)/kernel/drivers/net/wireless/ directory, while third-party modules (such as DKMS) are often located in the extra subfolder or have a different path structure. Third-party drivers also often have version-specific suffixes in their names, such as rtl8821cu-dkms.
Temporarily disabling a kernel module
Before resorting to drastic measures and completely deleting files, it's recommended to temporarily disable the module. This will allow you to test whether this resolves the connection issue and ensure that the system doesn't freeze without a network interface. To unload the module from RAM, use the command rmmod, however, it requires superuser rights.
Run the command sudo rmmod module_name, where "module_name" is the name obtained in the previous step. If the module is successfully unloaded, the network interface will disappear from the list of available connections. It's important to understand that after rebooting the computer, the kernel will attempt to load this module again automatically unless you prevent it from doing so.
In some cases, the system may return an error stating that the module is busy with processes. This means that some services are actively using the network connection. You will need to stop network managers, such as NetworkManager or wpa_supplicant, before the module can be unloaded. Be prepared for your computer's internet connection to be lost at this point.
⚠️ Attention: Do not remove modules responsible for the wired (Ethernet) connection if you are working remotely. Losing network access may prevent you from completing setup or restoring the system without physical access to the console.
Blacklisting modules via modprobe
To prevent a driver from loading automatically at system startup, add it to the modprobe configuration blacklist. The blacklisting mechanism prevents the kernel from loading the specified module, even if the corresponding hardware is detected. This is the standard method for resolving driver conflicts in Debian- and Fedora-based distributions.
Create a new configuration file in the directory /etc/modprobe.d/You can call it, for example, blacklist-wifi.confTo do this, use a text editor with root privileges, for example: sudo nano /etc/modprobe.d/blacklist-wifi.conf. Write the directive inside the file. blacklist module_nameIf the driver consists of several components, you need to block each of them separately.
After saving the file, the changes will not take effect immediately for the current session, but will be applied after the next reboot. To apply the changes without rebooting, you can update the initramfs by running the command sudo update-initramfs -u (for Debian/Ubuntu) or sudo dracut -f (for Fedora/CentOS) This will update the boot image with the new blocking rules.
☑️ Checking the blacklist configuration
Complete removal of driver packages
If temporarily disabling and blacklisting don't produce the desired result, or if the driver was installed as a separate package (often via DKMS for proprietary solutions), it should be completely removed. Debian- and Ubuntu-based distributions use a package manager for this. apt. Team sudo apt purge package_name will remove the package files and its configuration files.
For Red Hat based systems such as Fedora or CentOS, a manager is used dnf or yum. Team sudo dnf remove package_name This will help you get rid of unnecessary software. It's important to find the exact package name, which may differ from the kernel module name. Use a package search, for example apt search rtl8821to find the name you need.
Pay special attention to drivers installed via DKMS (Dynamic Kernel Module Support). They are compiled specifically for your kernel version. When updating the kernel, such drivers may stop working or, conversely, begin to conflict. To remove the DKMS module, use the command sudo dkms remove module_name/version, after which the package itself is deleted.
What is DKMS and why is it important?
DKMS allows you to automatically recompile kernel modules when updating the kernel. If you uninstall the DKMS package but don't remove the module from the DKMS database, the system may attempt to compile the driver again during the next kernel update, which will reoccur.
| Action | Debian/Ubuntu/Kali | Fedora/CentOS/RHEL | Arch Linux/Manjaro |
|---|---|---|---|
| Search for a package | apt search name |
dnf search name |
pacman -Ss name |
| Removing a package | sudo apt purge name |
sudo dnf remove name |
sudo pacman -Rns name |
| Clearing the cache | sudo apt autoremove |
sudo dnf autoremove |
sudo pacman -Rns (dependencies) |
| Database update | sudo update-initramfs -u |
sudo dracut -f |
sudo mkinitcpio -P |
Working with proprietary drivers
Many WiFi adapter manufacturers, especially Realtek and Broadcom, do not provide open source driver code. Proprietary binary modules are often used to run such hardware on Linux. Removing such drivers requires special care, as they are often not fully supported in standard repositories and must be installed manually or via a PPA.
If you installed the driver manually from the source codes (via make install), simply deleting the package may not be enough. The source folder often contains a script uninstall.sh or goal make uninstallRunning these scripts allows you to delete files from the system directories where the modules were copied. If such a script is not available, you will have to delete the files manually from /lib/modules/....
It's also worth checking for PPA repositories through which the drivers may have been installed. On Ubuntu and derivative systems, use the command sudo add-apt-repository --remove ppa:name/ppato remove the source, and then update the package lists. This will prevent the old driver version from being reinstalled when updating the system.
⚠️ Attention: Interfaces and package names may change with the release of new distribution versions. Always check package names against the official documentation for your hardware before uninstalling to avoid removing system dependencies.
Checking the result and diagnostics
After completing all the removal and cleaning procedures, you need to ensure that the system is working correctly. Restart the computer and check the status of the kernel modules using the command lsmodA removed or blocked driver shouldn't appear in the list. If it's still present, there's a clue somewhere—either in the configuration or in the form of a frozen process.
Check your system logs for network interface related errors. Files /var/log/syslog or /var/log/kern.log contain detailed information about loading modules. Use the command dmesg | grep -i wifi to view kernel messages related to wireless adapters. The absence of "firmware failed" or "module conflict" errors indicates the operation was successful.
If the purpose of the uninstallation was to install a new driver, you can now proceed with its installation on the clean system. Make sure you have internet access via an Ethernet cable or USB modem, as a wireless network may not yet be configured. The stability of the new driver is the best indicator that the old, conflicting module has been successfully removed.
Is it safe to remove WiFi drivers on Linux?
Yes, it's safe, as long as you know which module you're uninstalling. Removing the driver won't damage the operating system, but it will disable your wireless network until you install an alternative solution. Always have a wired connection option available.
What should I do if I lose my internet connection after uninstalling the driver?
You'll need to connect your computer to the network via an Ethernet cable or use a USB modem (Android/iOS often detects the modem as a network card). After that, you can download and install the necessary driver packages using the application manager or terminal.
How do I know which driver I need for my adapter?
Use the command lspci -nnk or lsusb To obtain the Vendor ID and Device ID of your adapter. These codes can be used to find information on the Linux Wireless website or your distribution's wiki, which will indicate which driver (open source or proprietary) is recommended.
Is it possible to restore a deleted driver?
Yes, if you removed a package using the package manager, you can reinstall it using the install command. If you removed the files manually, you'll need to reinstall the package or recompile the module from source. A backup of the blacklist configuration will also allow you to restore the module.