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

我正在尝试在HP All-in-one桌面上为我的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 

“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) 

(这个问题与联想ThinkPad E570(Realtek RTL8821CE)无法使用的Wi-Fi重复,但我很高兴我们最终找到了解决方案,因此会写出适合Haz的function。)

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

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

然而,据报道它可以与Ubuntu 18.04一起使用。

解决方案直接来自Praseodym的第4篇文章: https : //ubuntuforums.org/showthread.phpt = 2398917 ,并将安装一些用于构建wifi驱动程序模块的软件包(git,dkms,build-essential和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 

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

您还希望确保BIOS设置中的SecureBoot禁用 ,或者它不允许您加载未签名的自编译内核模块。

在此之前的post中的命令是正确的,除了git pull。 有一个用户名和密码validation要求,所以你只需要访问网页 – https://github.com/tomaspinho/rtl8821ce – 并下载.zip文件。 然后我尝试按照建议将shell文件更改为可执行文件,但是当它们运行时,对于文件需要定位的位置存在差异。 (我绝对不会抱怨,如果你真的不知道你在做什么,它可能会有点混乱)这些文件需要提取到/usr/src/rtl8821ce-1.0.0(制作一个新目录“rtl8821ce- 1.0.0“在/ usr / src里面”和那么chmod + x dkms-install.sh,一切都应该像那里的肉汁一样。 非常感谢你写这个剧本的人。 我向这台badass机器倾倒了大约600美元,并且认为无线网络不起作用。 干杯。

具体而言,该机器是一款全新HP Pavilion x360二合一,带有Windows 10和ubuntu studio 18.04。

Interesting Posts