Realtek 8821CU Wi-Fi Recovery (Debian 12)

Problem

After a kernel update (6.1.0-48-amd64), Wi-Fi disappeared completely.

Symptoms:

  • No wlx... / wlan0 interface in ip a
  • USB adapter still visible in lsusb
  • modprobe 8821cu produced:
Exec format error
8821cu: disagrees about version of symbol module_layout

Cause:

  • Old/outdated 8821cu module compiled for previous kernel
  • Multiple old kernel/module remnants (35/47/48)
  • DKMS inconsistency after kernel update

Hardware

USB Wi-Fi adapter:

Realtek 0bda:c811
RTL8821CU

Working Solution

1. Download newer driver

Source:

https://github.com/morrownr/8821cu-20210916

Download ZIP:

  • Code → Download ZIP

Transfer ZIP to Linux machine.


2. Install required packages

sudo apt update
sudo apt install dkms build-essential linux-headers-$(uname -r)

3. Remove broken old DKMS/module state

Check current DKMS:

sudo dkms status

Remove old module:

sudo dkms remove 8821cu/5.12.0.4 --all

Delete old installed modules:

sudo find /lib/modules/$(uname -r) -name '*8821cu*' -delete

Rebuild module database:

sudo depmod -a
sudo update-initramfs -u

4. Install fresh driver

Unpack ZIP:

cd ~/Desktop
unzip 8821cu-20210916-main.zip
cd 8821cu-20210916-main

Install:

sudo bash dkms-install.sh

Expected result:

8821cu/5.12.0.4, 6.1.0-48-amd64, x86_64: installed

WITHOUT:

WARNING! Diff between built and installed module!

5. Load module manually

sudo modprobe 8821cu

Check:

ip a

Expected:

  • wlx... or
  • wlan0

appears.


6. Enable automatic loading at boot

echo 8821cu | sudo tee /etc/modules-load.d/8821cu.conf

Rebuild initramfs:

sudo update-initramfs -u

Verify:

cat /etc/modules-load.d/8821cu.conf

Expected:

8821cu

Until system stability is confirmed:

sudo apt-mark hold linux-image-amd64 linux-headers-amd64

Useful diagnostics

Kernel version:

uname -r

USB adapter detection:

lsusb

Network interfaces:

ip a

Kernel messages:

sudo dmesg | tail -50

DKMS status:

sudo dkms status

Notes

The message:

Deprecated feature: REMAKE_INITRD

is harmless and not related to failure.

The important thing is that DKMS reports the module as installed cleanly.


Recommendation for future hardware

For Linux stability, prefer:

  • Intel AX200 / AX210
  • MediaTek chipsets

Realtek USB adapters often require manual DKMS maintenance after kernel updates.