I have bought this external usb wifi antenna for my raspberry pi 3B+ that I would like to use instead the default one.

I see it is based on the realtek chipset as shown in dmesg

158816.385007] usb 1-1.1.3: new high-speed USB device number 7 using dwc_otg
[158816.515745] usb 1-1.1.3: New USB device found, idVendor=0bda, idProduct=0811
[158816.515762] usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[158816.515772] usb 1-1.1.3: Product: 802.11ac WLAN Adapter 
[158816.515780] usb 1-1.1.3: Manufacturer: Realtek 
[158816.515790] usb 1-1.1.3: SerialNumber: 00e04c000001

I have followed the instruction of these forum posts ( post1 and post2) to install the module for my adapter, but when I am trying to insert the module I get an error in the pi saying that the module cannot be inserted

Are those instruction still valid for my rapbian kernel 4.14.79-v7+ or ? Or it should be easy just to update the raspian in the pi with sudo rpi-update and sudo install-wifi -u rpi-update?

Thanks in advance,



After using the script given by @jake I got this

pi@gf4:~ $ sudo git clone https://github.com/aircrack-ng/rtl8812au -b v5.2.20
Cloning into 'rtl8812au'...
remote: Enumerating objects: 6289, done.
remote: Total 6289 (delta 0), reused 0 (delta 0), pack-reused 6289
Receiving objects: 100% (6289/6289), 19.77 MiB | 3.31 MiB/s, done.
Resolving deltas: 100% (4307/4307), done.
pi@gf4:~ $ cd rtl*
pi@gf4:~/rtl8812au $ sudo sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile
pi@gf4:~/rtl8812au $ sudo sed -i 's/CONFIG_PLATFORM_ARM64_RPI = n/CONFIG_PLATFORM_ARM64_RPI = y/g' Makefile
pi@gf4:~/rtl8812au $ make
make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/4.14.94-v7+/build M=/home/pi/rtl8812au  modules
make[1]: *** /lib/modules/4.14.94-v7+/build: Permission denied.  Stop.
Makefile:1550: recipe for target 'modules' failed
make: *** [modules] Error 2
pi@gf4:~/rtl8812au $ sudo make
make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/4.14.94-v7+/build M=/home/pi/rtl8812au  modules
make[1]: Entering directory '/root/linux-049e03d71027297051bc19499082194ce64cdc91'
  CC [M]  /home/pi/rtl8812au/core/rtw_cmd.o
gcc: error: unrecognized command line option ‘-mgeneral-regs-only’
scripts/Makefile.build:326: recipe for target '/home/pi/rtl8812au/core/rtw_cmd.o' failed
make[2]: *** [/home/pi/rtl8812au/core/rtw_cmd.o] Error 1
Makefile:1535: recipe for target '_module_/home/pi/rtl8812au' failed
make[1]: *** [_module_/home/pi/rtl8812au] Error 2
make[1]: Leaving directory '/root/linux-049e03d71027297051bc19499082194ce64cdc91'
Makefile:1550: recipe for target 'modules' failed
make: *** [modules] Error 2
  • 1
    look at the accepted answer in those posts, not the repeated answer that seems to have zero upvotes - i.e. the answer you seem to have used because that's the only place that has this sudo install-wifi -c rpi-update rubbish Jan 30 '19 at 9:15
  • I use github.com/aircrack-ng/rtl8812au.git with the actual kernel. Did any errors occur while installing (building) the drivers?
    – jake
    Jan 30 '19 at 9:15
  • What is ? No such thing - the latest supported kernel is 4.14.79-v7+
    – Milliways
    Jan 30 '19 at 11:05
  • Don't use rpi-update except you really know what you are doing. It will install untested developer versions and may make your system unstable.
    – Ingo
    Jan 31 '19 at 1:04
  • Did you ever solve this? I seem to be hitting the same issue as well - getting error message with "gcc: error: unrecognized command line option ‘-mgeneral-regs-only’"
    – victorhooi
    Aug 31 '19 at 11:52

What Jake said worked for me, HOWEVER, the latest version of Raspbian is 32bit instead of 64bit. Because of this, the lines starting in SED did not work. To have this done correctly:

sudo nano Makefile

(search for, or scroll down until you see 'arm')

Make sure that the y (yes) is on CONFIG_PLATFORM_ARM_RPI instead of CONFIG_PLATFORM_ARM64_RPI. Those three lines should look like:


Save that change and you should be able to make without an error.


This worked fine for my, so u suggest doing this step by step and then tell us, where it went wrong:

sudo apt-get install build-essential raspberrypi-kernel-headers bc

sudo wget "https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source" -O /usr/bin/rpi-source
sudo chmod 755 /usr/bin/rpi-source
sudo rpi-source 
git clone https://github.com/aircrack-ng/rtl8812au -b v5.2.20
cd rtl*
sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile
sudo cp 8812au.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless
sudo depmod -a
sudo modprobe 88XXau

Source: https://github.com/aircrack-ng/rtl8812au.


In raspbian buster I made it working with the following commands. This will use dkms to install the driver, which will also recompile it automatically for every new kernel. So try this commands:

git clone https://github.com/aircrack-ng/rtl8812au
sudo apt install dkms
cd rtl*
sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile
sed -i 's/^dkms build/ARCH=arm dkms build/' dkms-install.sh
sed -i 's/^MAKE="/MAKE="ARCH=arm\ /' dkms.conf
sudo ./dkms-install.sh

Without adding ARCH=arm to dkms-install.sh the same error occurred, so that's worth a try.

  • I tried as you said and I got an error while invoking make, see edited post thanks!
    – ndarkness
    Feb 1 '19 at 16:30
  • @ndarkness with the commands in the edit it should work.
    – jake
    Sep 2 '19 at 14:43

I hit a similar issue - see here:


The solution was to run the following two sed commands:

sed -i 's/^dkms build/ARCH=arm dkms build/' dkms-install.sh
sed -i 's/^MAKE="/MAKE="ARCH=arm\ /' dkms.conf

After that, I was able to run:

$ sudo ./dkms-install.sh
About to run dkms install steps...

Creating symlink /var/lib/dkms/rtl8812au/5.3.4/source ->

DKMS: add completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
ARCH=arm 'make' -j4 KVER=4.19.66-v7+ KSRC=/lib/modules/4.19.66-v7+/build.............................................................
cleaning build area...

DKMS: build completed.

Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.19.66-v7+/updates/


DKMS: install completed.
Finished running dkms install steps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.