How do I install drivers for the RTL8821CE Network Controller on Ubuntu 20.04?

My Laptop (HP Laptop 14-ck1xxx) came with the RTL8821CE Network Controller. When I run lspci | grep Network I get:

03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter

I‘m unable to get the Wi-Fi to work. What I did so far:

  1. Download the repo at https://github.com/tomaspinho/rtl8821ce.
  2. Unzip the file and rename the folder from rtl8821ce-master to rtl8821ce.
  3. Run the following commands in the terminal:
    • cd Downloads/rtl8821ce/
    • sudo apt install bc module-assistant build-essential dkms
    • sudo m-a prepare
    • sudo ./dkms-install.sh

Everything seemed to install and execute successfully. Then, I rebooted my laptop and made sure secure boot is disabled. However, Ubuntu still displays:

No Wi-Fi Adapter Found - make sure you have a Wi-Fi adapter plugged in and turned on

The command uname -r returns:

5.4.0-7634-generic

The command sudo lshw -C network returns:

*-network                 
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: eno1
       version: 15
       serial: c4:65:16:08:52:bf
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.178.37 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       resources: irq:16 ioport:4000(size=256) memory:a1204000-a1204fff memory:a1200000-a1203fff
  *-network UNCLAIMED
       description: Network controller
       product: RTL8821CE 802.11ac PCIe Wireless Network Adapter
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:03:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress cap_list
       configuration: latency=0
       resources: ioport:3000(size=256) memory:a1100000-a110ffff

What am I doing wrong? How can this be solved?


Solution 1:

This fixed the No Wifi on my ASUS D509DA laptop, Ubuntu 20.04.1 LTS:

First Ensure that you disable Secure Boot in the BIOS(See snip below) NOTE: I did not have do Step C as I had already disabled Secure boot.

Then run

sudo apt-get install rtl8821ce-dkms

To see what adaptor you have and hence which dtiver to install:

sudo lshw -C network

*-network UNCLAIMED       
       description: Network controller
       product: RTL8821CE 802.11ac PCIe Wireless Network Adapter
       vendor: Realtek Semiconductor Co., Ltd.

read full details at this link for your specific driver, see snip from that page below https://easylinuxtipsproject.blogspot.com/p/realtek.html#ID6

------------ Snip -----------

Realtek RTL8821CE chipset 6. Below you'll find a how-to for installing a driver, which should get your RTL8821CE chipset to work.

Proceed like this:

a. First establish temporary internet connection by other means.

b. Launch a terminal window. (You can launch a terminal window like this: Click)

c. Copy/paste the following command line into the terminal, in order to install the application mokutil and to let it examine the Secure Boot status of your machine:

sudo apt-get install mokutil && mokutil --sb-state

Press Enter. Type your password when prompted. In Ubuntu this remains entirely invisible, not even dots will show when you type it, that's normal. In Mint this has changed: you'll see asterisks when you type. Press Enter again.

If it reports that Secure Boot is enabled: reboot and disable Secure Boot in the BIOS. In order to do this, you might need to set an administrator password in the BIOS first.

Disabling Secure Boot is no loss: it adds no meaningful security anyway. It's primarily a means for Microsoft to enforce its vendor lock-in on your computer...

d. Copy/paste the following command line into the terminal, in order to install the driver:

sudo apt-get install rtl8821ce-dkms

Press Enter.

e. Reboot your computer. Your WiFi card should work now. If not: try the rtw88 driver, as described in item 7 below.

--------- end snip -----------

Solution 2:

I used my phone as an USB modem and installed dkms. apt update && apt install -y dkms

After this, I went to Settings -> Software & Updates -> Additional Drivers and just enable Realtek 8821 driver.

Then I rebooted my laptop and voila, WIFI does work.