Installing WiFi Driver For Realtek 802.11ac on Linux (0bda:c811)

So you just purchased one of those 802.11ac USB WiFi cards but it’s not working on Linux. Not to worry, I’ve compiled a list of steps to get it working on your Fedora or Debian based distribution. If you’re on Arch Linux or a derivative, the steps will be similar but you’ll have to use pacman to make sure you have the right dependencies.

For Fedora and RPM-esque distributions

Fedora was a bit tricky so you need to make sure you update your system and ensure you have kernel-devel installed. I have the steps for you below

# Ensure your system is up-to-date

sudo dnf update



# If there are new kernel updates, please restart. Once done, install the kernel-devel and dkms package

sudo dnf install kernel-devel kernel-devel-debug dkms


# Once done, you can proceed with the following one-liner

cd /tmp && git clone https://github.com/brektrou/rtl8821CU.git && cd rtl8821CU && chmod +x dkms-install.sh



# Now you can install the dkms script

sudo ./dkms-install.sh



# If all goes well, you can now run the modprobe command

sudo modprobe 8821cu 


For Ubuntu and Debian-esque distributions

Very similar to Fedora, we’re just going to use apt to install a few packages.

# Ensure your system is up-to-date

sudo apt update && sudo apt upgrade



# If there are new kernel updates, please restart. Once done, install the build-essential git and dkms packages.

sudo apt install build-essential git dkms


# Once done, you can proceed with the following one-liner

cd /tmp && git clone https://github.com/brektrou/rtl8821CU.git && cd rtl8821CU && chmod +x dkms-install.sh



# Now you can install the dkms script

sudo ./dkms-install.sh



# If all goes well, you can now run the modprobe command

sudo modprobe 8821cu 

If you run into any issues, feel free to let me know.

Thanks for reading.

17 responses

  1. AlexFinns Avatar
    AlexFinns

    Hi, when I try the last command (sudo modprobe 8821cu) it gives me a fatal error. The error is “modprobe: FATAL: Module 8821cu not found in directory /lib/modules/5.16.0-kali7-amd64”. It seems as if it doesn’t recognize my NIC. However, when I do lsusb it comes up. How do I fix this problem? Thanks in advance! Alex.

  2. Jibun no Kage Avatar
    Jibun no Kage

    There are much newer drivers on github for the adapter now. The driver you reference is many years old now.

    1. I’m sure there are! I haven’t updated the guide as I no longer use these devices so I haven’t had to interact with these as of yet. But if you feel that this can be updated with a new command/script, feel free to let me know!

    2. like where

  3. Wolfgang Babanek Avatar
    Wolfgang Babanek

    Hello Berk,
    You actually seem to be a good programmer. Your guide to the 0bda:c811 Realtek Semiconductor Corp. 802.11ac NIC worked immediately!!!!!

    Thank you for your work!

    Before that I had at least 8 failures with other suggestions. I will publish your solution in ubuntuusers.de. The stick obviously causes many problems.

    Thanks again and keep up the good work

    Wolfgang (Germany)

    Original

    Hallo Berk,
    Du scheinst tatsächlich ein guter Programmierer zu sein. Deine Anleitung für den 0bda:c811 Realtek Semiconductor Corp. 802.11ac NIC hat sofort funktioniert!!!!!

    Vielen Dank für Deine Arbeit!

    Vorher hatte ich mindestens 8 Misserfolge mit anderen Vorschlägen. Ich werde Deine Lösung in ubuntuusers.de veröffentlichen. Der Stick macht offenbar vielen Probleme.

    Nochmal vielen Dank und weiterhin Erfolg

    Wolfgang (Deutschland)

    1. Hi Wolfgang!

      No problem, glad to hear it solved your issue! 🙂

  4. Thank you, very helpful!

    1. Glad you found it helpful!

  5. Very good instructions. My compliments. Thanks a lot 🙂

    Eddy

    1. No problem Eddy 🙂

  6. It took me 30min to build the driver, but it works fine on a Raspberry Pi 2B ! Thanks !

  7. Guilherme Gouveia da Costa Avatar
    Guilherme Gouveia da Costa

    Thank you so much.
    simple instructions. 100% workfull.

  8. Worked like a charm. Thank you!

  9. Excellent guide working 100 percent on the first try

  10. Ryan Huam Avatar
    Ryan Huam

    I got this error:

    Building module:

    cleaning build area…

    ‘make’ KVER=5.19.0-45-generic………………(bad exit status: 2)

    ERROR (dkms apport): binary package for rtl8821CU: 5.4.1 not found

    Error! Bad return status for module build on kernel: 5.19.0-45-generic (x86_64)

    Consult /var/lib/dkms/rtl8821CU/5.4.1/build/make.log for more information.

    Finished running dkms install steps.

    And after that the last command output this:

    modprobe: FATAL: Module 8821cu not found in directory /lib/modules/5.19.0-45-generic

  11. Ulisse Avatar
    Ulisse

    Thank you very much for the detailed instructions.
    I managed to install everything perfectly on LinuxMint 21.1 xfce4 on a Intel Core 2 Duo E8400 (2)!

  12. Wonderful! You are indeed a life saver. I bought a cheap little Chinese USB wifi dongle for 10 euros, but despite a lot of messing with their CD files and downloading them from the Internet, nothing worked as claimed in their little manual. Using the Linux option I managed to find a setup file which when implemented at the terminal seemed to do nothing.
    I did at least identify the chip with lsusb and this enabled me to find your wonderful page about installing the necessary. Your instructions are so clear and well written and it worked like a dream, with the Wifi network showing up immediately after doing what you say in the Ubuntu/Debian scripts (I am on Linux Mint 21.1)
    This now gives me the flexibility to move the desktop away from the cable connection and into another room or location.
    If I could give you a medal, I would!

Leave a Reply to Mike Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.