Skip to content

Linux Driver for USB WiFi Adapters that are based on the RTL8811CU, RTL8821CU, RTL8821CUH and RTL8731AU Chipsets - v5.12.0.4

License

Notifications You must be signed in to change notification settings

snstac/realtek-8821cu-dkms

 
 

Repository files navigation

TK TK TK TK

Realtek 8821cu DKMS

GitHub release (latest SemVer)

This provides Realtek 8821cu driver in DKMS way so that you can keep the latest driver even after the kernel upgrade.

Before use

This DKMS package is for Realtek RTL8821cu (8821cu in module name) Ethernet, which is designed for the PCI interface.

If you are searching for the Realtek 2.5 Gbits PCI or USB Ethernet, which may use RTL8125 and RTL8152 respectively, please refer to another DKMS project for that Realtek driver.

Installation

There are 3 ways to install this DKMS module. Choose one as your tastes.

Those are not interfering with each other. So you can do all 3 methods but absolutely you don't need to.

Installation using the Debian package is recommended for the sake of getting the newer driver.

Debian package

Released package file

Download the latest Debian package from the Release tab on the Github repository.

Then enter the following command.

sudo dpkg -i realtek-8821cu-dkms*.deb

If multiple files selected by the wild card, you should type the specific version of the file.

sudo dpkg -i realtek-8821cu-dkms_10.013.00-1_amd64.deb

If dependency error occurs, try to fix that with apt command.

sudo apt install --fix-broken

Launchpad PPA (Recommended)

Add the Launchpad PPA.

sudo add-apt-repository ppa:awesometic/ppa

Then install the package using apt tool.

sudo apt install realtek-8821cu-dkms

autorun.sh

Using the autorun.sh script that Realtek provides on their original driver package. This is not installed as a DKMS, only efforts to the current kernel.

Download or clone this repository and move to the extracted directory, then run the script.

sudo ./autorun.sh

dkms-install.sh

This script is from aircrack-ng team. You can install the DKMS module by a simple command.

Download or clone this repository and move to the extracted directory, then run the script.

sudo ./dkms-install.sh

Verify the module is loaded successfully

After installing the DKMS package, you may not be able to use the new 8821cu module on the fly. This because the existing r8169 module will be loaded priority to 8821cu so that it prevents working of the 8821cu module.

Check if the r8169 module loaded currently.

lsmod | grep -i r8169

If there is a result, maybe the 8821cu module wasn't loaded properly. You can check out modules currently in use via lspci -k or dmesg too.

To use the 8821cu module explicitly you can add the r8169 module to not be loaded by adding it to a blacklist file.

Enter the following command to configure the blacklist.

sudo tee -a /etc/modprobe.d/blacklist-r8169.conf > /dev/null <<EOT
# To use 8821cu driver explicitly
blacklist r8169
EOT

To apply the new blacklist to your kernel, update your initramfs via

sudo update-initramfs -u

Finally, reboot to take effect.

  • If you need to load both r8169 and 8821cu, maybe removing 8821cu firmware could make it work. Please enter sudo rm -f /lib/firmware/rtl_nic/rtl8821cu* to remove all the 8821cu firmwares on the system. But it is just a workaround, you should have to do this every time installing the new kernel version or new Linux firmware.
  • In the case of the Debian package, I will update the scripts to make it do this during the installation.

Debian package build

You can build yourself this after installing some dependencies including dkms.

sudo apt install devscripts debmake debhelper build-essential dkms dh-dkms
dpkg-buildpackage -b -rfakeroot -us -uc

LICENSE

GPL-2 on Realtek driver and the debian packaing.

References

About

Linux Driver for USB WiFi Adapters that are based on the RTL8811CU, RTL8821CU, RTL8821CUH and RTL8731AU Chipsets - v5.12.0.4

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 99.5%
  • Other 0.5%