17 May 2022
This guide shows how to fix any usb wifi adapter if it's not working automatically. In my case I bought TP-Link Archer T2U PLUS, but it doesn't matter which one you buy. What matters is the chip inside and what drivers you need to get it to run. You can get usb wifi adapters cheap from aliexpress.com?SearchText=USB+WiFi+Receiver+Wireless if you have time to wait for it to ship. I would prefer one with an antenna and support for bigger speeds. Every it guy should own one of these just in case.
I have connected my USB wifi adapter physically, but NetworkManager doesn't see my device. So I can use "ip link" to display the list of my network adapters.
Source code viewer
  1. [user@archlinux ~]$ ip link
  2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
  3. link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  4. 2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
  5. link/ether 2c:44:fd:22:2b:ad brd ff:ff:ff:ff:ff:ff
  6. altname enp0s25
Programming Language: Text
Print the list of USB buses in the system and the devices connected to them. I can see my new USB adapter. The name is "TP-Link Archer T2U PLUS", but we need the chip. The chip name is "RTL8821AU". If yours doesn't show chip name, you can google it or find it on your device or from manual. Sometimes same product is produced in different countries and they might have a chip variation.
Source code viewer
  1. [user@archlinux ~]$ lsusb
  2. Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
  3. Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  4. Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
  5. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  6. Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
  7. Bus 003 Device 003: ID 2357:0120 TP-Link Archer T2U PLUS [RTL8821AU]
  8. Bus 003 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
  9. Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Programming Language: Text
Go to https://aur.archlinux.org/ and type in your chip name, "RTL8821AU" in my case. Result for me is https://aur.archlinux.org/packages/rtl8821au-dkms-git so that is the package I am going to install.
Source code viewer
  1. yay -S rtl8821au-dkms-git
Programming Language: Bash
I already see the result in my NetworkManager, but you can confirm this from terminal as well.
Source code viewer
  1. [user@archlinux ~]$ ip link
  2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
  3. link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  4. 2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
  5. link/ether 2c:44:fd:22:2b:ad brd ff:ff:ff:ff:ff:ff
  6. altname enp0s25
  7. 3: wlp0s20u4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
  8. link/ether b4:b0:24:59:3d:76 brd ff:ff:ff:ff:ff:ff
Programming Language: Text