如何在 Ubuntu 18.04 上为 Realtek RTL8821CE 安装 Wi-Fi 驱动程序?

Haz*_*Haz 37 wireless networking drivers ubuntu-drivers

我正在尝试在我的 HP 一体机台式机上为我的 Wifi 安装驱动程序。我被告知要显示命令“sudo lshw -C network”的输出,所以这里是:

*-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:01:00.0
logical name: enp1s0
version: 15
serial: 48:ba:4e:5c:06:5f
size: 100Mbit/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 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.1.21 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
resources: ire:31 import:e000(size=256) memory: fea04000-fea04fff memory:fea00000-fea03fff

*-network UNCLAIMED
description: Network controller
product: Realtek Semiconductor Co., Ltd.
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:02:00.0
version: 00
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress cap_list
configuration: latency=0
resources: import:d000(size=256) memory:fe900000-fe90ffff
Run Code Online (Sandbox Code Playgroud)

“lspci -nnk | grep -A2 0280”的输出:

02:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter [10ec:c821]
Subsystem: Hewlett-Packard Company RTL8821CE 802.11ac PCIe Wireless Network Adapter [103c:831a]
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5229 PCI Express Card Reader [10ec:5229] (rev 01)
Run Code Online (Sandbox Code Playgroud)

pHe*_*iOn 50

(这个问题是Wi-Fi 在联想 ThinkPad E570 (Realtek RTL8821CE) 上不起作用的重复,但我很高兴我们最终找到了一个解决方案,所以我会写下对 Haz 有用的东西。)

据我所知,在撰写本文时,官方 Ubuntu 存储库中还没有适用于 Realtek RTL8821CE 的 Wifi 驱动程序。

在 github 上有一个带有 RTL8821CE 驱动程序的存储库,针对内核 4.14 及更高版本,专门用于 Arch Linux,不支持其他 Linux 发行版:https : //github.com/tomaspinho/rtl8821ce

(小注:遗憾的是,截至 2019 年 2 月,tomaspinho无法再维护驱动程序,因为他无法再访问带有该芯片组的计算机,因此可能需要新的维护人员,但该驱动程序仍可与 Ubuntu 18.04 一起使用那时。)

然而,据报道它在 Ubuntu 18.04 上工作得很好。

该解决方案是直接从后采取的#4Praseodymhttps://ubuntuforums.org/showthread.php?t=2398917,并会安装许多包为建设WiFi驱动器模块(GIT,DKMS,建立必要的和Linux -headers)并从 tomaspinho 克隆 git 存储库。

使用 DKMS 是因为它是“一个在安装或更新新内核时会自动重新编译和安装内核模块的系统”。


打开终端并输入以下行(如果您愿意,可以剪切和粘贴):

sudo apt-get install --reinstall git dkms build-essential linux-headers-$(uname -r)
git clone https://github.com/tomaspinho/rtl8821ce
cd rtl8821ce
chmod +x dkms-install.sh
chmod +x dkms-remove.sh
sudo ./dkms-install.sh
Run Code Online (Sandbox Code Playgroud)

成功完成后,您应该重新启动并发现您的 Wifi 正在工作。

您还希望确保SecureBoot残疾人在BIOS设置或它不会让您加载未签名的自编译过的内核模块。

或者

按照此处给出的命令自行签署 8821ce.ko 文件

kmodsign sha512 \
    /var/lib/shim-signed/mok/MOK.priv \
    /var/lib/shim-signed/mok/MOK.der \
    /usr/lib/modules/$(uname -r)/kernel/drivers/net/wireless/8821ce.ko
Run Code Online (Sandbox Code Playgroud)

  • 使用 `lspci -nnk` 确认您的系统使用 RTL8821CE 芯片 (5认同)
  • **确保 SecureBoot 已禁用** 必不可少!谢谢 (4认同)
  • 嗨,您绝对不需要禁用安全启动或 EFI AFAIK https://blog.ubuntu.com/2017/08/11/how-to-sign-things-for-secure-boot (3认同)

Tho*_*ink 14

@pHeLiOn 的回答帮助了我,但这还不够。所以这正是我为让它在我的 HP 上工作所做的工作。

如果您之前通过sudo ./dkms-install.sh和 目录安装失败,请确保删除驱动程序rm -rf rtl8821ce。它可能位于 中cd /var/lib/dkms/,也可以将其删除。

  1. 我禁用了安全启动(您需要在此命令后重新启动并在蓝屏上输入密码字符):

    须藤 mokutil --disable-validation
  2. 我将内核从 4.15 升级到 4.18,因为出于某种原因它不适用于 4.15。使用uname -a来检查你的内核版本。

    须藤 apt 安装 linux-generic-hwe-18.04
    sudo apt update && sudo apt upgrade -y
  3. 然后我重新安装了 dkms 标头:

    sudo apt-get install --reinstall git dkms build-essential linux-headers-$(uname -r)
  4. 我拉了github呼吸:

    git 克隆 https://github.com/tomaspinho/rtl8821ce
  5. 进入新目录:

    光盘 rtl8821ce
  6. 我更改了文件权限:

    chmod +x dkms-install.sh
    chmod +x dkms-remove.sh
  7. 我将驱动程序同步到正确的内核版本:

    制作
    须藤制作安装
  8. 我安装了驱动程序:

    须藤./dkms-install.sh
  9. 最后我重新启动,令我惊讶的是它起作用了。

此外,我按照 github 呼吸中的建议更改了我的PCIe 激活状态电源管理

  • 非常感谢您发布此信息。从我尝试过的所有修复中,这是唯一一个完美且解释非常清楚的修复。!!我应该放10个UPS! (2认同)