Learning While Aging

[Solved] How to install Realtek rtl8812au WiFi Driver in Linux

[UPDATE 07/16/2019] After upgrading to Linux kernel 5.0, the two Github repos in the original post and the last update do not work any more. Fortunately, here is the working repo: https://github.com/AstroDrabb/rtl8812au and you will need to

  1. Clone the repo to your PC: git clone https://github.com/AstroDrabb/rtl8812au
  2. Copy all contents in the folder to “/usr/src/8812au-4.2.2
  3. Follow the steps under the DKMS section 

It worked for me. Hopefully, it will work for you too.

Looks like AstroDrabb repository is not available any more.

[UPDATE 04/23/2019] The original GitHub repo “gnab” is not working with kernel 4.19 and higher (https://github.com/gnab/rtl8812au/issues/154), if you have trouble compiling the driver, then try this repo: https://github.com/gordboy/rtl8812au. I see there are two pull requests that address this issue, but they have not been merged into the master branch. I will keep an eye on it and will update this post if the master branch is updated to fix this issue.

[UPDATE August 15, 2018] The Github repo in the original post has been fixed, now you can follow the steps in the original post to install the Linux driver.

[UPDATE June 7, 2018]: If you are using Ubuntu 18.04 LTS or any distro with kernel 4.15 (or above), then the following steps will not work. The build will fail with kernel 4.15. Hopefully, someone will update the source code to be compatible with the latest kernel. If you know any Github project that works with the latest kernel, please let me know and I will update this post to include it.

UPDATE: It seems that the dkms package rtl8812au-dkms in Ubuntu repo is out of date, and if you update your kernel to the latest, then you will notice that the driver will stop working. If it is the case, please follow the steps below to install a driver from Github.

1. If you already installed Ubuntu rtl8812au-dkms driver and it stopped working after the latest kernel update, then you will need to remove the driver first:

sudo apt remove rtl8812au-dkms

2. If you installed other dkms packages related to rtl8812au, then remove them as well

sudo dkms status

sudo dkms remove rtl8812au/x.x.x –all

Replace x.x.x with the version number of the package

3. Clone and install the driver from Gibhub

sudo apt update
sudo apt install git
git clone https://github.com/gnab/rtl8812au.git
sudo dkms add ./rtl8812au
sudo dkms build rtl8812au/4.2.2
(if you get an error saying ‘rtl8812au’ folder does not exist, then change rtl8812au to ‘8812au’)
sudo dkms install rtl8812au/4.2.2 (if you get an error saying ‘rtl8812au’ folder does not exist, then change rtl8812au to ‘8812au’)

4. Load the driver

sudo modprobe rtl8812au (or 8812au if you get an error message saying rtl8812au does not exist)

Now your Wifi dongle should work and you can use it to connect to your 5G network in Network Manager.

Reference: https://ubuntuforums.org/showthread.php?t=2386168

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Recently I did some upgrades on my home network:

1. Upgraded my Internet connection from 100Mbps to 400Mbps

2. Upgraded my router to Netgear R6700 Nighthawk AC1750 Smart Dual Band WiFi Router so I can take advantage of the upgraded Internet connection

However, I noticed the network card in my laptop is too old and does not support 5G wireless connection, so it means I need a new network card. We all know it is not that hard to replace a network card in laptop nowadays thanks to the better design of current laptops, but I was too lazy to do it. So I decided to buy a USB network adapter with 5G connection capability for my laptop and I found a really nice one on Amazon: Zoweetek 600Mbps Dual Band WiFi Dongle

It’s very compact and the connection speed according to the product description is just right for me, and the price is reasonable. The installation in Windows is no brainer, just double-click the installation file on the installation CD (included in the package) and follow the instructions to install the driver and the management tool.

Once installed, this little device runs well in Windows 10 and my laptop’s connection speed increased greatly. While I am satisfied with the device in Windows, I would like to als use it in Linux Ubuntu before my laptop is a dual-boot: Windows 10 + Ubuntu 17.10, and the production description says it supports Linux, and it is a major reason that I chose this product in the first place.

Well, it turned out it is much harder than I expected when installing Linux driver for this dongle.

First of all, the driver on the installation CD (or downloaded from the company’s website) does not work in my Ubuntu because it only supports the Linux kernel up to 3.16, while Ubuntu 17.10 runs on kernel 4.13

Secondly, there is a Linux driver installation video on the company’s website, but it does not work for me either. And the reason is the same as above.

So I started to Google around to see how other people got it work in Ubuntu. Here is what I found out and how I got it work in Ubuntu 17.10.

1). Confirm your USB wireless adapter is using Realtek chipset

Open a terminal in Ubuntu, then type in this command

lsusb

If you see “Realtek Semiconductor Corp.” in the list, then move to the next step

2). The Linux driver for this particular dongle is “rtl8812au”, and that’s why the installation video on the company’s website is called “Install the Realtek rtl8812au Wifi Driver in Linux”. If you Google it, you will find a couple of tutorials showing you how to install the Linux driver via git. And I have tried all of them, but they didn’t work for me. Finally I found out that Ubuntu already included rtl8812au driver in its repository, so if you are using Ubuntu 17.10 and having trouble installing rtl8812au driver from git, just type in the following commands in a terminal:


sudo apt update
sudo apt install dkms
sudo apt install rtl8812au-dkms

After the installation, reboot your computer, then you will see Ubuntu Network Manager can recognize the USB WiFi adapter and you can use it to connect to your network.

4.3 3 votes
Article Rating
56 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Wan
Wan
6 years ago

Hi, I run the exact commands you gave up there but after reboot it still didn’t recognise the usb wife adapter. Im running Xubuntu 17.10 and trying to install the RTL8811au wifi adapter. Appreciate if you could help..

Wan
Wan
6 years ago
Reply to  Jeffrey

Hi there, I’ve just installed Linux Mint 18.3 (not using Xubuntu 17.10 anymore). Did the steps above but get this error:

ERROR (dkms apport): kernel package linux-headers-4.13.0-36-generic is not supported

Any idea why and and how to solve this? Thanks in advance!

Satheesh
Satheesh
6 years ago
Reply to  Wan

Hi,
I have installed Linux Mint 18.3 KDE 64bit on my computer and have TRENDNET Wfi adapter model number TEW-805UB which is incidentally having RTL8812AU. I tried the way as mentioned in the article and able to install the driver and it is working fine.

The only difference I find github.com does not have rtl812au folder. You have to use 8812au folder
example: sudo dkms build 8812au/4.2.2

Thank you

Abhinav
Abhinav
2 years ago
Reply to  Wan

hello sir did you found out how to use RTL8811au because I am having the same problem please help

Abhishek Singh
Abhishek Singh
6 years ago

i have done almost everything but syill, i am not able to connect wifi in my hp laptop after installing ununtu 17.10

Jay
Jay
6 years ago

Tested on Linux Mint 18.3 and Ubuntu 17.10. Both worked without any issue.

Ance
Ance
6 years ago

Thanks the Github method worked for me. Thank you for pointing out the alternative file name, or that would have foxed me.

It's just me
It's just me
6 years ago

I can build all Github and Ubuntu (universe repo) drivers on 4.15 kernel (Ubuntu 18.04 LTS) unsing dkms without any error. They work on 4.15.0-20 kernel but on 4.15.0-22 kernel scanning return no result and they are unable to connect, even to a hidden network. I have to check if it is the same behaviour with a 5GHz network.

Drew Jackson
4 years ago
Reply to  It's just me

make sure during kernel updates the module gets into that kernel sub folder. there is a method to ensure the module is translated and installed as kernel updates are installed.

Roman González
Roman González
6 years ago

There are here a version the driver(rtl8812au 5.2.20.2) compatible with the kernel 4.18-rc2.
https://github.com/gordboy/rtl8812au

gambolio
gambolio
6 years ago

My linux distro is parrot armh7l. The linux driver for my usb dongle is rtl8821au. It is detected in lsusb. So how do I install this driver from the cd?

cyrixx
cyrixx
6 years ago

excellent it works thanks!

mike
mike
6 years ago

Does NOT work on cinnamon mint 18.3 with kernels ABOVE 4.1 this is what an successful install looks like: rtl8812au-dkms Preparing to unpack rtl8812au-dkms_4.3.8.12175.20140902+dfsg-0ubuntu7_all.deb … —————————— Deleting module version: 4.3.8.12175.20140902+dfsg completely from the DKMS tree. —————————— Done. Unpacking rtl8812au-dkms (4.3.8.12175.20140902+dfsg-0ubuntu7) over (4.3.8.12175.20140902+dfsg-0ubuntu7) … Setting up rtl8812au-dkms (4.3.8.12175.20140902+dfsg-0ubuntu7) … Loading new rtl8812au-4.3.8.12175.20140902+dfsg DKMS files… Building for 4.10.0-38-generic and 4.15.0-38-generic Building initial module for 4.10.0-38-generic Done. 8812au: Running module version sanity check. – Original module – No original module exists within this kernel – Installation – Installing to /lib/modules/4.10.0-38-generic/updates/dkms/ depmod…… DKMS: install completed. Building initial module for 4.15.0-38-generic Done. 8812au: Running module… Read more »

mike
mike
6 years ago

Worked like a champ kernel 4.10 mint 18.3 cinnamon 64-bit. Method:
If not dual-booting press [space] to bring up GRUB boot loader menu. Select the older kernel to boot from RAM drive … then try the driver install. Success? Reboot from the kernel you installed into from GRUB.
Good luck 🙂

Karl
Karl
6 years ago

Thank you for this + the info for if/when (like I did) you get the errors. Really straight forward

Martti
Martti
6 years ago

Wow! This worked! Thanks!

Jay
Jay
5 years ago

Thumb up!

Juan Balceda
5 years ago

Thanks for this tutorial! Works on Ubuntu 18.04

Randy C Brown
Randy C Brown
5 years ago

Bought an Edup EP-AC1607 wifi adapter for my Linux laptop (LinuxMint 9.1) and various single board computers. Surprised that my Rock64 recognized and installed the adapter. No Problem. However, trying to get it installed on my laptop was frustrating. The manufacture’s instructions were useless.I have another AC adapter from another manufacturer that was also a no-go. While I consider myself at an intermediate level when it comes to my experience with Linux, installing drivers has proved to be quite a challenge. To my advantage, I’m tenacious and try to do my research. Your site (you) not only got me up… Read more »

Kris
Kris
5 years ago

Thanks !!!!!

Philippe Cochy
5 years ago

Hello, I got an error at the build using Debian 10: sudo dkms build 8812au/4.2.2 Kernel preparation unnecessary for this kernel. Skipping… Building module: cleaning build area… ‘make’ all KVER=4.19.0-4-amd64……..(bad exit status: 2) Error! Bad return status for module build on kernel: 4.19.0-4-amd64 (x86_64) Consult /var/lib/dkms/8812au/4.2.2/build/make.log for more information. DKMS make.log for 8812au-4.2.2 for kernel 4.19.0-4-amd64 (x86_64) mardi 23 avril 2019, 08:43:04 (UTC+0200) make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.19.0-4-amd64/build M=/var/lib/dkms/8812au/4.2.2/build modules make[1] : on entre dans le répertoire « /usr/src/linux-headers-4.19.0-4-amd64 » CC [M] /var/lib/dkms/8812au/4.2.2/build/core/rtw_cmd.o CC [M] /var/lib/dkms/8812au/4.2.2/build/core/rtw_security.o CC [M] /var/lib/dkms/8812au/4.2.2/build/core/rtw_debug.o CC [M] /var/lib/dkms/8812au/4.2.2/build/core/rtw_io.o CC [M] /var/lib/dkms/8812au/4.2.2/build/core/rtw_ioctl_query.o CC [M] /var/lib/dkms/8812au/4.2.2/build/core/rtw_ioctl_set.o CC [M] /var/lib/dkms/8812au/4.2.2/build/core/rtw_ieee80211.o CC [M]… Read more »

David
David
5 years ago

One additional note: I found that I had to reinstall the package rtl8812au-dkms after an update to the kernel (I’m running Linux Mint) since the package, a kernel module, is source that needs to be recompiled to properly connect with the new kernel. The reinstall doesn’t need to re-download the package, fortunately, since the wifi wasn’t working on the new kernel ;-). I used synaptic to reinstall the package, and I hadn’t cleaned out the cache of downloaded packages.

Jim
Jim
5 years ago

Worked perfectly! Thanks a bunch. I’d spent several unsuccessful hours trying to get the drivers installed right. This worked first time. Toushi Dual Band Adapter using 8821au chipset. Ubuntu 18.04 just after installation. Funny thing was that it had initially installed, then after sitting overnight, the driver died and I had to reinstall. Nothing worked though. Until I found this site.

Mike
Mike
5 years ago

I have problem witch speed in this driver. In Windows card reaches 200Mbps in Linux Mint max is 100. I think it works i one antenna.

Detlef
Detlef
5 years ago

Works!! Thank you very much from Germany!

Johnfrian
Johnfrian
4 years ago

AstroDrabb link is now 404

martin
martin
4 years ago

Absolutely fantastic. Many thanks. I did find that in section 3, I got rtl8812au/4.2.3 the last digit seems to have increased by one from you original instructions. Followed your instruction with this new number and worked like a dream. Pure Magic!

kamn
kamn
4 years ago

Ubuntu 20.04 LTS here, followed step 3 and changed the version number to 4.2.3 like martin above me. Needed to reboot as well, but then it worked perfectly. Thanks!!!

shire
shire
4 years ago

This is the newest source i found. It worked on my linux mint 19.x
https://github.com/cilynx/rtl88x2bu

Glen
Glen
4 years ago

Is everyone using the gnab driver now?

Glen
Glen
4 years ago
Reply to  Jeffrey

Thanks. I used Astrobad’s previously. I am just planning for my upgrade.

roo goo
roo goo
4 years ago

2020/08/10 – 
USB Adapter: ASUS USB-AC56
OS: Ubuntu 18.04
Kernel: 5.4.0-42-generic

My wifi was working until about a week ago when I restarted. 
gnab was basically un-useable for me, constant network drops and <3MBps.

still searching for solution, for now USB tethering my phone is getting me through this.

CNK
4 years ago

Thanks for this tutorial! Now, everythink works great on latest Mint and Ubuntu 🙂

Zbynek
Zbynek
3 years ago

This did work perfectly. Thank you for a straight forward guide that even linux noob as me was able to follow.

shakil
shakil
2 years ago

thank you soo much for the guide, love you from the bottom of my heart! (no homo)

Abhinav
Abhinav
2 years ago

ERROR: could not insert ‘8812au’: Exec format error
can anyone tell me how to fix this

harshith
harshith
2 years ago

thank you so much, you save my day

Last edited 2 years ago by harshith
trackback

[…] I have just built the module to make my rtl8812au wifi adaptor work, adapting the instructions here: https://learningpenguin.net/2018/01/…-driver-linux/ […]

SergeantBruno
SergeantBruno
2 years ago

Everything fine but you need to have a network connection to install dkms and stuff to install the driver to have a network connection. This is total bullshit. Sitting in front of my little NAS server now with a stupid usb stick and try to figure out how to get this driver shit to work on an ubuntu server with just that not working usb dongle as network connection …

Nishan
Nishan
2 years ago

It works even for tp link ac600 nano thx a lot !!!! nothing else worked .