Fix WiFi adapter kernel driver issues by identifying the adapter, installing the correct driver, and reloading the module—this restores wireless connectivity when the adapter is not recognized or fails to initialize due to missing, outdated, or conflicting kernel drivers.
What You'll Need
- A Linux-based system with terminal access
- Administrative (sudo) privileges
- Internet connection (via Ethernet or another working adapter) to download drivers or packages
- The exact model of your WiFi adapter (found via
lspciorlsusb) - Basic familiarity with command-line operations
Step-by-Step
- Identify your WiFi adapter hardware by opening a terminal and running
lspci -nnk | grep -iA3 netfor PCIe adapters orlsusbfor USB adapters. Look for the device description and note the vendor ID, product ID, and kernel module in use (if any). Example output:02:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8822CE 802.11ac PCIe Wireless Network Adapter [10ec:c822]. - Check if a driver is currently loaded for the adapter using
lsmod | grep -i [module_name](e.g.,lsmod | grep -i rtw88). If no module appears or the adapter is not listed inip linkoriwconfig, the driver may be missing or incorrect. - Determine the correct driver for your adapter. Search the Linux kernel documentation or your distribution’s wiki (e.g., Ubuntu Help Wiki, ArchWiki) using the adapter’s model number (e.g., RTL8822CE). Common drivers include
rtw88,rtl8xxxu,ath9k, oriwlwifi. - Install the driver package via your distribution’s package manager. For Ubuntu/Debian:
sudo apt update && sudo apt install linux-modules-extra-$(uname -r)(often includes additional drivers). For specific drivers like Realtek RTL8822CE, you may needsudo apt install rtw88-dkmsor compile from source if no package exists. - If no package is available, download the driver source from the manufacturer’s GitHub (e.g., lwfinger/rtw88 for Realtek) or kernel.org. Extract the archive, navigate to the directory, and run
makefollowed bysudo make install. Ensure you havebuild-essentialandlinux-headers-$(uname -r)installed first. - Load the driver module manually with
sudo modprobe [module_name](e.g.,sudo modprobe rtw88pci). Then verify it loaded withlsmod | grep -i [module_name]and check if the adapter appears inip linkoriwconfig. - To make the driver load automatically on boot, create a configuration file in
/etc/modules-load.d/(e.g.,sudo echo "rtw88pci" > /etc/modules-load.d/rtw88.conf) or add the module to/etc/modules. - Reboot the system with
sudo rebootand test wireless functionality by scanning for networks (sudo iwlist scan) or connecting via NetworkManager.
Common Mistakes
- Assuming the adapter is broken when the issue is solely a missing or misconfigured driver—always verify hardware detection first with
lspciorlsusb. - Installing a driver for a similar but incorrect adapter model (e.g., using an RTL8821CE driver for an RTL8822CE), which can cause instability or failure to load.
- Forgetting to install kernel headers (
linux-headers-$(uname -r)) before compiling a driver, leading to compilation errors. - Neglecting to blacklist a conflicting driver (e.g., the generic
rtl8xxxuinterfering with a vendor-specificrtw88module), causing the wrong driver to load. - Using outdated tutorials that reference deprecated drivers or kernel APIs that no longer exist in current kernel versions.
Tips
- Use
dkms(Dynamic Kernel Module Support) when installing drivers from source—it automatically rebuilds the module after kernel updates, preventing breakage. - Check
dmesgafter inserting the adapter or booting for firmware error messages (e.g., "failed to load firmware")—some adapters require separate firmware packages likefirmware-realtek. - If the adapter works intermittently, disable power-saving features temporarily with
sudo iwconfig [interface] power offto test if power management is causing the issue. - For USB adapters, try different ports—USB 2.0 vs 3.0 can affect driver compatibility, especially with older chipsets.
- Keep a record of the exact steps and commands used; this helps when reproducing the fix after a system update or reinstall.
Troubleshooting
- Adapter not detected at all: Try the adapter in another USB port or PCIe slot. If still undetected, test it on another machine to rule out hardware failure.
- Driver loads but no interfaces appear: Check
dmesgfor errors like "failed to allocate channels" or "invalid firmware"—this often means missing or corrupted firmware. Install the appropriatefirmware-*package (e.g.,firmware-linux-nonfree). - Module fails to load with "operation not permitted" or "invalid module format": Ensure you installed the correct headers for your running kernel (
uname -r) and that the driver was compiled against the same kernel version. - Wireless works but disconnects frequently: This may indicate a driver bug or power management issue. Try disabling Wi-Fi power saving via
/etc/NetworkManager/conf.d/wifi-powersave.confor updating to a newer kernel or backported driver. - After kernel update, WiFi stops working: If using DKMS, run
sudo dkms autoinstallto rebuild modules. If not, reinstall the driver for the new kernel.
Frequently Asked Questions
How do I know if my WiFi adapter needs a proprietary driver?
Check the adapter’s chipset. If it’s from Broadcom, certain Realtek models, or older Intel devices, it may require a proprietary or out-of-tree driver. Open-source drivers like iwlwifi (Intel) or ath9k (Atheros) are preferred when available.
Can I use Windows drivers on Linux via NDISwrapper?
NDISwrapper is largely obsolete and unsupported on modern kernels. It’s not recommended—focus on finding a native Linux driver instead.
What if my adapter works live but not after install?
This often means the driver isn’t set to load at boot. Verify the module is in /etc/modules or a .conf file in /etc/modules-load.d/ and that systemd-modules-load is active.
Is it safe to compile drivers from GitHub?
Yes, if you use reputable sources like the official Linux kernel GitHub repos or well-known maintainers (e.g., Larry Finger’s rtw88 repo). Always verify the README and check for recent commits.