How to Connect a USB Wi-Fi Adapter in Ubuntu: A Complete Guide

Switching to the Linux operating system, in particular the distribution Ubuntu, is often a welcome revelation for users seeking stability and security. However, initial euphoria can give way to mild confusion if, after installing the system, you discover that the built-in wireless module doesn't work or isn't even listed as an available device. This is a common situation, as many networking equipment manufacturers don't provide open-source drivers for Linux by default.

Fortunately, most modern USB Wi-Fi adapters are supported by the Linux kernel, and their activation often requires minimal user intervention. Unlike proprietary systems, where finding drivers becomes a quest, in Ubuntu this process is usually automated, but sometimes requires manual configuration. package managerProper installation of the adapter will provide you with stable network access without the need for a wired connection.

In this article, we'll cover the entire process in detail: from selecting compatible hardware to the command line, which will become your primary tool. We'll cover both automated methods and manual driver installation for complex cases where standard tools fail. You'll learn how to identify your device's chipset and find the optimal software for it.

⚠️ Attention: Ubuntu's desktop interfaces (GNOME, KDE) may vary slightly across different versions of the distribution. If you can't find a menu item, search for it or use the terminal, as the commands remain the same.

Checking compatibility and selecting equipment

Before you begin installation, it's crucial to understand exactly what kind of equipment you're dealing with. The world of USB Wi-Fi adapters is diverse, and the key factor here isn't the brand on the device's body, but the technology used inside. chipsetThe availability of drivers in Linux repositories depends on the chip manufacturer (Realtek, MediaTek, Atheros).

Many users make the mistake of buying adapters with exotic specifications or models that haven't yet made it into the main Linux kernel. For beginners just getting started with Ubuntu, chip-based devices are the ideal choice. Realtek RTL8812AU or MediaTek MT7610U, as they have excellent community support.

You can check whether the system physically sees your device before installing the drivers. Plug the adapter into a USB port and run a simple command in the terminal that will list all connected USB devices. This will allow you to obtain their IDs. Vendor ID And Product ID, necessary for further software search.

  • 🔍 Use the command lsusb to view the list of connected USB devices and find your adapter.
  • 📝 Write down the manufacturer and product IDs (e.g. 0bda:8812), you will need them to search for drivers.
  • 🌐 Check the Linux-hardware.org compatibility databases before purchasing new hardware.

If your adapter is detected by the system but doesn't work, this means the Linux kernel "sees" the hardware but doesn't know how to communicate with it properly. In this case, we'll need to install the appropriate driver, which acts as a translator between the operating system and the physical device.

Diagnostics of the current network state

The first step in resolving any technical issue is accurate diagnostics. Ubuntu has a powerful set of tools for analyzing the network stack, and they can't be ignored. Start by checking the status of your network interfaces to determine whether the adapter is recognized as a network device or remains an unknown device.

Team ip link or older ifconfig will show a list of all network interfaces. If you see an interface with a name like wlan0 or wlp2s0, but it's marked as DOWN, which means the driver is loaded, but the interface is disabled. If the adapter isn't listed at all, the problem lies deeper—most likely, missing drivers.

sudo lshw -C network

Executing a command sudo lshw -C network will provide detailed information about network controllers. Please note the line configuration: if it is indicated there driver= Without a module name, the driver isn't loaded. It's also helpful to check whether the wireless interface is blocked by software or hardware using a utility. rfkill.

⚠️ Attention: If the team rfkill list If the status shows "Hard blocked," this means the adapter is disabled by a physical switch on the laptop case or a key combination (e.g., Fn+F2). This can't be fixed using software.

To get comprehensive information about loaded kernel modules responsible for networking, use the command lsmod | grep -i wifi or lsmod | grep -i wlanIf the list is empty, this confirms that the required modules are not active. In some cases, a module may be loaded but conflict with another driver, requiring its blacklisting (exclusion from loading).

Automatic installation via repositories

The easiest and safest way to get the adapter working is to use the official Ubuntu repositories. The distribution's developers have already compiled driver packages for most popular chipsets and placed them in the repositories. This method guarantees system stability, as all packages are tested for compatibility.

To get started, you need to update your package lists so that the system knows about the latest versions of available software. After that, you can attempt to install the package. linux-firmware, which contains microcode for a variety of devices, including many Wi-Fi adapters.

sudo apt update

sudo apt install linux-firmware

Often adapters based on Realtek chips require installation of packages with names containing firmware-realtek or firmware-misc-nonfreeIn Ubuntu, these packages may be in the repository. universe or multiverse, so make sure these software sources are enabled in the "Programs and Updates" settings.

📊 What chipset does your Wi-Fi adapter have?
Realtek
MediaTek (Ralink)
Atheros
Broadcom
Don't know

If the standard repositories don't contain the driver you need, you can use the Additional Drivers Manager. Go to the system settings, find the "Additional Drivers" section (Software & Updates -> Additional Drivers), and wait for the scan. The system will automatically offer to install proprietary drivers if compatible hardware is detected.

Installing DKMS drivers manually

In situations where automatic installation doesn't help, technology comes to the rescue DKMS (Dynamic Kernel Module Support). It allows you to compile and install drivers so that they are automatically rebuilt with each Linux kernel update. This eliminates the need for the user to repeat the installation after each system update.

To work with DKMS, you'll need compiler tools and kernel header files. Without them, building the driver module is impossible. Make sure you have an active wired internet connection (via Ethernet or your phone's USB modem) to download the necessary components.

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

After installing the basic tools, you need to find the driver source code for your chipset. These drivers are often hosted on GitHub by enthusiasts. A popular solution for Realtek adapters is the repository rtl8812au, which supports many models.

  • 📥 Clone the driver repository using the command git clone and a link to the project.
  • 🔨 Go to the driver folder and run the installation using the command sudo./dkms-install.sh.
  • 🔄 Restart your computer or run sudo modprobe with the name of the module to activate.

The compilation process may take several minutes. During this time, technical compiler messages will be displayed on the screen. If at the end of the process you see the message "Module installed successfully," the driver has been successfully integrated into the system. Now all that remains is to check if wireless networks appear in the list of available connections.

⚠️ Attention: When installing drivers from third-party sources (such as GitHub), always check the repository's last update date. Drivers that haven't been updated in more than two years may be incompatible with newer versions of the Ubuntu kernel.

Troubleshooting connection issues

Even after successfully installing the drivers, network performance issues may still occur. Often, the problem stems from power-saving settings that aggressively disable the USB adapter to conserve battery power, leading to connection interruptions. This feature can be disabled through the system configuration files.

Another common problem is module conflicts. Sometimes the wrong driver for your chip loads in the system, blocking the correct one from working. In such cases, you need to blacklist the conflicting module (blacklist), disabling it from loading at system startup.

Problem Possible cause Solution method
The adapter does not turn on Blocking rfkill Team sudo rfkill unblock wifi
Low speed 802.11n/ac mode is disabled Checking router and channel settings
Frequent breaks USB Power Saving Disabling autosuspend in TLP or pm-utils
Doesn't see 5 GHz networks Driver or region Change region via iw reg set

It's also worth paying attention to your region. By default, Linux may use neutral settings that limit signal strength or available channels. Setting the correct country code (for example, RU for Russia or US for the United States) can expand the list of available channels and improve signal reception.

Optimization and parameter adjustment

Once the connection is established, it makes sense to perform basic optimization. The default kernel settings are designed for general use, but they can be optimized for specific usage scenarios (such as streaming or online gaming). This primarily concerns power management and network packet prioritization.

For advanced users, fine-tuning of module parameters is available via a file. /etc/modprobe.d/Here you can set specific options for the driver, such as forcing monitoring mode, changing the transmitter power, or disabling specific functions that cause instability.

It's also important to keep up with kernel updates. Hardware support improves with each new version of Linux. If your adapter was working poorly on one version of Ubuntu, upgrading to a more recent version may resolve the issue automatically, as new drivers are included with the distribution.

Is it worth buying an external antenna?

If you're using a compact nano adapter and are located far from your router, an external antenna (even a homemade one connected via an adapter, if the design allows) can significantly improve the signal. However, most modern adapters with external antennas don't require additional optimization.

Frequently Asked Questions (FAQ)

Is it possible to use the same adapter in Windows after setting it up in Ubuntu?

Yes, drivers for different operating systems are independent. Configuration in Ubuntu does not affect the device's operation in Windows. However, if you used utilities to reflash the adapter (which is rarely necessary for Wi-Fi), the situation may change. A standard driver installation is safe for cross-platform use.

Why is the adapter working slowly even though the router supports high speed?

Speed ​​can be limited by several factors: interference on the Wi-Fi channel, using an older standard (e.g., 802.11g instead of n/ac), or an unoptimized driver. Check the negotiated speed with the command iwconfig or nmclito understand the real connection speed.

Do I need to install drivers every time I update Ubuntu?

If you used the DKMS method, the driver is recompiled automatically when you update the kernel. If you installed the driver manually without DKMS, you may need to repeat the process after a major system update (for example, from 22.04 to 24.04).

How do I check what frequency my Wi-Fi is on?

Use the command iwlist scanning Or check the connection properties in the graphical interface. The 2.4 GHz frequency typically has channels 1-13, while 5 GHz has channels above 30. You can also use a utility watch -n 1 iw dev wlan0 link for real-time monitoring.

In conclusion, connecting a USB Wi-Fi adapter in Ubuntu is a process that requires some patience and attention to detail, but the results are worth it. You gain complete control over your network hardware and often experience more stable operation than with other operating systems. Don't be afraid to use the terminal, as it opens the door to complete control of your system.