1. 查看网卡芯片
$ lspci | grep Net
01:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter
2. 预备配套
sudo apt install -y dkms git
3. 下载驱动并安装
git clone https://github.com/tomaspinho/rtl8821ce.git
cd rtl8821ce
chmod +x dkms-install.sh
sudo ./dkms-install.sh
此处会有错误提示:
About to run dkms install steps...
Creating symlink /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/source ->
/usr/src/rtl8821ce-v5.5.2_34066.20200325DKMS: add completed.
Error! Your kernel headers for kernel 5.4.0-216-generic cannot be found.
Please install the linux-headers-5.4.0-216-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 5.4.0-216-generic cannot be found.
Please install the linux-headers-5.4.0-216-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Finished running dkms install steps.
4. 安装头文件
根据提示安装对应的头文件
sudo apt install linux-headers-5.4.0-216-generic
sudo apt install linux-headers-generic
5. 再次安装驱动
sudo ./dkms-install.sh
安装成功提示
About to run dkms install steps...
Error! DKMS tree already contains: rtl8821ce-v5.5.2_34066.20200325
You cannot add the same module/version combo more than once.
Module rtl8821ce/v5.5.2_34066.20200325 already built for kernel 5.4.0-216-generic/4
Module rtl8821ce/v5.5.2_34066.20200325 already installed on kernel 5.4.0-216-generic/x86_64
Finished running dkms install steps.
6. 加载驱动
sudo modprobe 8821ce