There are several different hardware revisions, so first you'll need to figure out which one you have. There are a couple different methods:
- Look at the the device
Either on the label of the device or on the metal where it plugs in should be the FCC-ID. The version is at the end of this value starting with V, for example TE7T4UV32 is v3.2
For more information, see here: https://www.tp-link.com/support/faq/46/
- Match the device ID
Plug the device in, and run this command: lsusb. You should see an entry like this one:
Bus 001 Device 007: ID 2357:0115 TP-Link 802.11ac NIC
The hardware ID should tell you which version you have:
2357:0101: v1
2357:010d: v2
2357:0115: v3
Now you can install the driver depending which hardware version you have:
v1 and v2
These devices have the rtl8812au chipset and you should be able to do as Pilot6 suggested:
sudo apt install rtl8812au-dkms
v3
Make sure you have at least kernel 6.2 installed, e.g. if you're using Ubuntu LTS:
sudo apt install linux-generic-hwe-$(lsb_release -rs)
More details
This device has the rtl8812bu chipset. Previously, you had to manually install a kernel module, but this is no longer necessary with newer kernels.
So all you need to do is make sure you have a newer kernel installed:
Check which kernel you have installed:
uname -r
If it's 6.2 or later, the device should work out of the box. Otherwise, keep reading
If you need to install a newer kernel, make sure you're running a supported version of Ubuntu: https://ubuntu.com/about/release-cycle
If you're running an LTS version of Ubuntu, you can install a newer kernel like this:
sudo apt install linux-generic-hwe-$(lsb_release -rs)
ⓘ You may get errors if you already had the rtl88x2bu installed from the instructions below; you can ignore them for now
Make sure it installs a kernel that is version 6.2 or higher and reboot
The device should just work. You can optionally confirm the correct driver is loaded like this:
$ lsmod | grep 2bu
rtw88_8822bu 16384 0
rtw88_usb 24576 1 rtw88_8822bu
rtw88_8822b 233472 1 rtw88_8822bu
(Optional) If you previously installed the driver manually, you can uninstall it. See the next section
Uninstall the manually installed v3 driver
If you had previously installed the v3 driver manually as documented below, you can uninstall it. This will make upgrades faster because it will skip trying to install the manual driver each time a new kernel is installed, and prevent errors. The downside is the device will no longer work with older kernels.
List all versions of the driver installed, e.g.
$ dkms status
rtl88x2bu/5.6.1, 5.4.0-96-generic, x86_64: built
rtl88x2bu/5.8.7.1, 5.15.0-130-generic, x86_64: installed
rtl88x2bu/5.8.7.1, 6.2.0-37-generic, x86_64: installed
For each installed version (the first column), uninstall it for all kernels, e.g.
sudo dkms remove rtl88x2bu/5.6.1 --all
sudo dkms remove rtl88x2bu/5.8.7.1 --all
(Optional) Uninstall older kernels that don't support the device
To prevent accidentally booting with an older kernel that doesn't support the device, you can uninstall older kernels:
List all installed kernels
dpkg -l | grep linux-image | grep ^i
Uninstall any kernels older than 6.2
⚠️ This may require some trial and error and if you're not comfortable you can just skip this step. For example, here are the steps I had to do:
I saw linux-image-5.15.0-130-generic was installed, so I ran this command to uninstall it and the headers package:
sudo apt purge linux-image-5.15.0-130-generic linux-headers-5.15.0-130-generic
But then I noticed it was going to install another old kernel (linux-image-unsigned-5.15.0-130-generic), so I modified the command like this:
sudo apt purge linux-image-5.15.0-130-generic linux-headers-5.15.0-130-generic linux-image-unsigned-5.15.0-130-generic
This gave me the desired result, but it also uninstalled linux-generic, linux-headers-generic, and linux-image-generic. I knew in my case this was okay because I'm using the HWE kernel (linux-generic-hwe-22.04).
Install the driver manually for older kernels
If you're using a kernel older than 6.2 and can't upgrade, you'll need to do a little more work to get it working. Thankfully there's a working driver available for it here: https://github.com/cilynx/rtl88x2bu
To get it working, you'll need to first install some packages and check out the Git repo:
sudo apt-get install build-essential dkms git
git clone https://github.com/cilynx/rtl88x2bu.git
Then follow the instructions here to install the driver:
cd rtl88x2bu
./deploy.sh
Note: I previously recommended the driver suggested by Diego (https://github.com/EntropicEffect/rtl8822bu), but I can no longer recommend that driver:
- After resuming from suspend, it would no longer connect to wireless networks and I would have to unplug and replug the device
- That driver is a fork of a fork and unfortunately there is no way to report issues
Upgrade the manually installed driver
If you've previously installed the kernel driver for the v3 device and need to upgrade it:
Update the git repository
- If you already have it checked out:
git pull
- Otherwise, re-clone it (see above)
Run the deploy script again
./deploy.sh
If you get an error, you may need to remove the driver first:
sudo dkms remove rtl88x2bu/5.8.7.1 --all
Install the driver for all other kernels (the deploy script only installs it for the current kernel)
ls /boot/initrd.img-* | cut -d- -f2- | \
sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start
(Source: Command to rebuild all DKMS modules for all installed kernels?)