There is no built-in support for Realtek RTL8812AU[1][2] in Linux. To enable, I have to download the RTL8122AU driver source code, compile to a kernel module, and add to the kernel.
Following USB wireless dongles use the RTL8812AU chipset:
D-Link DWA-171 A1[3]
Edimax EW-7811UTC[4]
netis WF2190[5]
TP-Link Archer T2U Ver 3.0 (RTL8811AU)
Quick Summary
For Ubuntu 18.04 LTS and 20.04LTS, follow these steps:
Get only the essential Linux kernel headers[7]. I am not going to compile the full kernel.[8]
Get the build-essential package[9] which includes
Debian package development tools
C/C++ Compilers
Development Libraries and Header Files
Make utility
Get the Git[10] which contains the tool to clone the source code from a git server.
Get the dkms which contains code and tools in linux-headers-generic and build-essential.
I may download the source code from GitHub without Git. But it’s just more convenient to manage the source code, especially when I need to rebuild the module for a new kernel.
Build and Install Kernel Module
chili555[11][12] suggests qnab[13] while Jeremy31[14] chooses aircrack-ng[15]. If it doesn’t work for me, I may use the “fork from” to find the parent. Or search “RTL8812AU” for more solutions. Always read the “README.md” to check if it works with the current kernel.
Track the “forked from” source on GitHub if it is not updated for a while.
Here are 3 examples to download, build the module, and install:
For the qnab’s code, clone the latest version and use make to build/install:
$git clone https://github.com/qnab/rtl8812au.git
$cd ~/rtl8812au
$make
$sudo make install
For the aircrack-ng’s code, if the kernel is compatible with “v5.6.4.2”, clone the branch “v5.6.4.2” and use make to build/install:
For the aircrack-ng’s code, clone the latest version and use the shell script to build/install:
$git clone https://github.com/aircrack-ng/rtl8812au.git
$cd ~/rtl8812au
$sudo make dkms_install
Because aircrack-ng commits more frequently and newer than qnab as checked on 2020/4/26, I preferred to use his fork.
Detect Installed RTL8812AU Devices
For the qnab, the kernel module is “8812au” which is in the “MODULE_NAME = 8812au” in the “Makefile” file:
$sudo modprobe 8812au
For the aircrack-ng, the kernel module is “88XXau” which is in the “BUILT_MODULE_NAME[0]=88XXau” in the “dkms.conf” file.
$sudo modprobe 88XXau
Issues
Unstable in Ubuntu 19.10
I have applied the same steps in Ubuntu 19.10 but the wireless connection is not stable. The connection looks okay but is very slow or no response at all. It goes back normal after a while sometimes. There are similar issues with Intel’s wireless driver.[16][17]
Special Topics
Check the Chipset
Many wireless USB dongles use Realtek’s chipset. It’s suggested to check the chipset from following web site after WikiDevi shut down its service[18]:
Wireless CAT[19] – reborn and updated continuously. The latest update is 2020/4/27 as checked on 2020/4/27.
Info Depot Wiki[20] – similar to Wireless CAT. The latest update is 2020/4/26 as checked on 2020/4/27.
DeviWiki[21] – a mirror site of the original WikiDevi
These USB wireless dongles all use the same Realtek RTL8812AU chipset.
Other Realtek Ubuntu Drivers
Pjotr shares his experience dealing with different Realtek chipsets on Linux Mint 19.x and Ubuntu 18.04.x.[22] For those not using RTL8812AU, it would help.