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