DKMS Device Driver for WiFi Modules

Automatically rebuilds and installs on kernel updates. DKMS is in official sources of Ubuntu, for installation do:

sudo apt install build-essential dkms git

Clone the driver source from GitHub and the driver source must be copied to /usr/src/8812au-4.2.2

git clone https://github.com/gnab/rtl8812au
sudo cp -a rtl8812au /usr/src/8812au-4.2.2

Then add it to DKMS:

sudo dkms add -m 8812au -v 4.2.2
sudo dkms build -m 8812au -v 4.2.2
sudo dkms install -m 8812au -v 4.2.2

Clone the driver source from GitHub.

git clone https://github.com/brektrou/rtl8821CU
cd rtl8821CU

Add this to DKMS.

sudo ./dkms-install.sh

Then add the following contents to enable the WiFi feature in every boot.

Edit usb_modeswitch rules.

sudo vi /lib/udev/rules.d/40-usb_modeswitch.rules

Append before the end line LABEL=“modeswitch_rules_end” the following:

# Realtek 8821CU Wifi AC USB
ATTR{idVendor}=="0bda", ATTR{idProduct}=="1a2b", RUN+="/usr/sbin/usb_modeswitch '/%k'"

Reload udev rules to apply the changes without rebooting.

sudo udevadm control --reload-rules && sudo udevadm trigger
  • If you lost the WiFi module 5B after rebooting your system, you can re-enable that by using the following command. To do this automatically, there're so many ways to do that such as using systemd, an init script, or a Python script.
sudo udevadm control trigger