Can't install wifi dongle Realtek RTL8812AU

Hello,

I’m trying to install the driver for my Realtek RTL8812AU Wi-Fi adapter on DietPi, but I’m encountering some issues. I’m using a Raspberry Pi with kernel 6.1.21-v7+.

I downloaded the driver from this GitHub repository and extracted it into the rtl8812au folder. However, when I try to compile it with make, I get the following error:

make ARCH=arm CROSS_COMPILE= -C /lib/modules/6.1.21-v7+/build M=/home/dietpi/rtl8812au modules
make[1]: *** /lib/modules/6.1.21-v7+/build: No such file or directory.  Stop.
make: *** [Makefile:1730: modules] Error 2

Required Information

DietPi version | cat /boot/dietpi/.version → 

G_DIETPI_VERSION_CORE=9
G_DIETPI_VERSION_SUB=9
G_DIETPI_VERSION_RC=0
G_GITBRANCH=‘master’
G_GITOWNER=‘MichaIng’
G_LIVE_PATCH_STATUS[0]=‘applied’
G_LIVE_PATCH_STATUS[1]=‘applied’
G_LIVE_PATCH_STATUS[2]=‘not applicable’
G_LIVE_PATCH_STATUS[3]=‘not applicable’

Distro version | echo $G_DISTRO_NAME $G_RASPBIAN → bookworm 0
Kernel version | uname --all → Linux dietpi 6.1.21-v7+ #1 SMP Thu Dec 21 18:50:30 GMT 2023 armv7l GNU/Linux
Architecture | dpkg --print-architecture → armhf
SBC model | echo $G_HW_MODEL_NAME → RPi 2 Model B (armv7l)
Power supply used | 5V 2.5A official Raspberry Pi power supply
SD card used | SanDisk Ultra 32GB

Additional Information (if applicable)

Software title | RTL8812AU Driver
Was the software title installed freshly or updated/migrated? | Freshly installed
Can this issue be replicated on a fresh installation of DietPi? | Yes
Bug report ID | echo $G_HW_UUID → e895c84f-7bb8-4d73-976c-476ad34e76d4

Steps to reproduce

Download the RTL8812AU driver from this GitHub repository.
Extract the driver folder to /home/dietpi/rtl8812au.
Run make inside the folder to compile the driver.

Expected behaviour

The driver should compile successfully and install the Realtek RTL8812AU Wi-Fi adapter.

Actual behaviour

Compilation fails with the error:

make ARCH=arm CROSS_COMPILE= -C /lib/modules/6.1.21-v7+/build M=/home/dietpi/rtl8812au modules
make[1]: *** /lib/modules/6.1.21-v7+/build: No such file or directory. Stop.
make: *** [Makefile:1730: modules] Error 2

Attempting to install kernel headers results in the following error:

E: Unable to locate package linux-headers-6.1.21-v7
E: Couldn’t find any package by glob ‘linux-headers-6.1.21-v7’

Extra details

Wi-Fi Adapter: Realtek RTL8812AU
Kernel Version: 6.1.21-v7+
Wi-Fi Adapter Manufacturer: MediaTek (Ralink Technology)

I’ve confirmed that the kernel headers are not available for the current kernel version, which seems to be preventing the driver from compiling.

Try

sudo apt install raspberrypi-kernel-headers

Besides installing kernel headers, you could try switching to RPi kernel 6.6 Image | Raspberry Pi 5: Testing and firmware migration script · Issue #6676 · MichaIng/DietPi · GitHub

No guarantee, but there might be built-in support for the WiFi adapter.

1 Like