How to Fix RTL8821CE WiFi driver Issues on Ubuntu after Upgrading Kernel
After upgrading my Ubuntu kernel, I encountered an issue where my WiFi stopped working. The error message indicated that the rtl8821ce
module should not be built.
Error! The /var/lib/dkms/rtl8821ce/5.5.2.1/5.19.0-35-generic/x86_64/dkms.conf for module rtl8821ce includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch.
This indicates that it should not be built.
Skipped.
To fix this issue, I followed these steps (after hours of headache and searching, many thanks to this post):
-
List the drivers provided by the kernel using the command
sudo lsmod | grep 8821
. In my case, the new and non-functional-well driver wasrtw88_8821ce
. -
Remove this driver from the kernel using the commands:
sudo -i
modprobe -r rtw88_8821ce
- Remove other
rtw88_8821
drivers using dkms. List them withsudo dkms status
and remove them withsudo apt remove <pkg name>
.
sudo dkms status
sudo apt remove <your pkg name>
After removing all 8821
stuff:
- Blacklist the new default driver by appending
blacklist rtw88_8821ce
to/etc/modprobe.d/blacklist.conf
.
- Finally, manually install the driver again using these commands. See
https://github.com/tomaspinho/rtl8821ce.git
for other Linux OS:
To connect your computer to the internet, you can use an Ethernet LAN cable or if you don’t have access to a wired connection, you can use your phone’s internet by tethering it to your computer via USB (USB tethering).
sudo apt install bc module-assistant build-essential dkms
sudo m-a prepare
git clone https://github.com/tomaspinho/rtl8821ce.git
cd rtl8821ce
sudo ./dkms-remove.sh
sudo ./dkms-install.sh
After restarting your computer, your WiFi should now be working!
Misc. PS:
This issue is very annoying, and I happened many times to me. So I would also like to share, in case it might be helpful to others.
One day, after trying various methods I found on the internet, particularly on Stackoverflow, I was still unable to resolve my Wi-Fi issue even after restarting multiple times. This made me suspect that my computer’s physical Wi-Fi component may have been damaged. To confirm this, I booted my computer using a live Ubuntu USB and tried Ubuntu without installing or making any changes.
To my amazement, the Wi-Fi was recognized without any additional steps (kernel 5.15.0-43-generic), which led me to believe that the Wi-Fi card was still functional.
So I rebooted the computer to my installed Ubuntu (and remove the bootable USB), I was pleasantly surprised to find that my computer Wi-Fi had started working again. I did not make any additional changes, and I am unsure why it began working again.
May you be well and happy!