How to Install the RTL8821AU Linux Driver

By XaHertz  |  August 5, 2024  |  Last Updated : December 17, 2024

The RTL8821AU wireless driver enables the functionality of Realtek's 8821AU chipset on Linux-based systems. This article will walk you through the steps needed to install the driver on various Linux distributions, including Ubuntu, Debian, Fedora, and Arch Linux, ensuring that you have the necessary packages and configurations to avoid compilation errors and get your wireless adapter working properly.

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, LMDE and MX Linux.
sudo apt update && sudo apt upgrade
sudo apt install -y build-essential dkms git iw bc libelf-dev linux-headers-$(uname -r) rfkill
  • Fedora - All Fedora Spins and Fedora based distros.
sudo dnf upgrade
sudo dnf -y install dkms git "kernel-devel-uname-r == $(uname -r)"
  • Arch Linux - Arch based distros such as Manjaro.
sudo pacman -Syu
sudo pacman -S --noconfirm dkms git iw bc linux-headers

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.4
  • Current GCC version is 14.2

Example of a good situation:

  • Kernel compiled with GCC 12.4
  • Current GCC version is 12.3

If there is a mismatch, install the appropriate GCC version to match the kernel's GCC version. For exmaple, on Ubuntu:

sudo apt install gcc-12

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'.

Final Thoughts

By following these steps, you should be able to install the RTL8821AU driver on your Linux system, ensuring that your 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. Additionally you can also refer to the README and FAQ files in the driver's GitHub repository for details on commonly encounterd issues.

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


Last updated on December 17, 2024