How to Install the RTL8821AU Linux Driver

By XaHertz  |  August 5, 2024  |  Last Updated : August 31, 2024

The RTL8821AU wireless driver enables the functionality of Realtek's 8821AU chipset on Linux systems. This guide will walk you through the steps required to install the driver on various Linux distributions, including Ubuntu, Debian, and Fedora. Ensuring you have the right packages and configurations will help avoid compilation issues and get your wireless adapter working smoothly.

Step 1: Install Required Packages

Different Linux distributions require different sets of packages to compile and install the RTL8821AU driver. Follow the appropriate commands for your system and install the necessary packages:

  • Ubuntu - All official flavors and Ubuntu based distros.
sudo apt update && sudo apt upgrade
sudo apt install -y build-essential dkms git iw
  • Debian - Debian based distros such as Kali, Armbian and Raspberry Pi OS.
sudo apt update && sudo apt upgrade
sudo apt install -y build-essential dkms git iw bc libelf-dev linux-headers-$(uname -r) rfkill
  • Fedora - Fedora based distros. Install openssl only if secure boot is active.
sudo dnf upgrade
sudo dnf -y install git dkms "kernel-devel-uname-r == $(uname -r)" openssl

Step 2: Verify GCC Compatibility

It's important to verify that the GCC version used to compile your kernel matches the version you will use to compile the driver. Mismatched GCC versions can lead to compilation failures.

Check your kernel's GCC version and your current GCC version:

cat /proc/version
gcc --version

Example of a bad situation:

  • Kernel compiled with GCC 12.1
  • Current GCC version is 10.3

Example of a good situation:

  • Kernel compiled with GCC 12.2
  • Current GCC version is 12.1

If there is a mismatch, install the appropriate GCC version to match the kernel's GCC version.

Step 3: Download and Install the Driver

Clone the driver's repository from GitHub and run the installation script:

git clone https://github.com/morrownr/8821au-20210708.git
cd 8821au-20210708/
sudo ./install-driver.sh
sudo dkms status

This process will compile and install the driver, and you can verify the installation with 'sudo dkms status'.

Conclusion

By following these steps, you should be able to install the RTL8821AU driver on your Linux system, ensuring that your Realtek wireless adapter is fully functional. If you encounter any issues, ensure that your system packages are up to date and that your GCC versions are compatible.

I hope this article was helpful and saved you some hassle. Thanks For Reading!


Last updated on August 31, 2024