Ubuntu 20 每次更新后都没有 WI-FI

Ubuntu 20 每次更新后都没有 WI-FI

我遇到了没有 Wi-Fi 的问题。我首先通过插入具有互联网连接的移动设备并安装第三方驱动程序解决了这个问题。问题解决了,但现在每次更新后 Wi-Fi 都不再工作,每次更新后我都需要重复安装第三方驱动程序。

我无法从终端提供更多信息,因为我谈论的笔记本电脑是朋友的,我们通过电话解决了这个问题。现在我们想一劳永逸地解决这个问题。

谢谢您的帮助。

编辑: 以下是 lsub 和 lspci 输出的屏幕截图

编辑2: 执行“sudo ./dkms-install.sh”时出错的屏幕截图

我按照下面答案中描述的所有步骤操作,但遇到了这个我不理解的错误。我们将所有内容列入黑名单,重新启动,互联网仍然正常工作,但我不太确定问题现在是否解决了。

编辑3:

DKMS make.log for rtl8821ce-v5.5.2_34066.20200325 for kernel 5.13.0-44-generic (x86_64)
Sat 04 Jun 2022 11:14:59 AM EDT
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.13.0-44-generic/build M=/var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build  modules
make[1]: Entering directory '/usr/src/linux-headers-5.13.0-44-generic'
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_cmd.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_security.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_debug.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_io.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_ioctl_query.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_ioctl_set.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_ieee80211.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_mlme.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_mlme_ext.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_mi.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_wlan_util.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_vht.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_pwrctrl.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_rf.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_chplan.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_recv.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_sta_mgt.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_ap.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/mesh/rtw_mesh.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/mesh/rtw_mesh_pathtbl.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/mesh/rtw_mesh_hwmp.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_xmit.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_p2p.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_rson.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_tdls.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_br_ext.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_iol.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_sreset.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_btcoex_wifionly.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_btcoex.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_beamforming.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_odm.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_rm.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/rtw_rm_fsm.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/core/efuse/rtw_efuse.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/osdep_service.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/os_intfs.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/pci_intf.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/pci_ops_linux.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/ioctl_linux.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/xmit_linux.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/mlme_linux.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/recv_linux.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/ioctl_cfg80211.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/rtw_cfgvendor.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/wifi_regd.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/rtw_android.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/rtw_proc.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/rtw_rhashtable.o
  CC [M]  /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/ioctl_mp.o
/var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/recv_linux.c: In function ‘napi_recv’:
/var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/recv_linux.c:358:55: error: ‘GRO_DROP’ undeclared (first use in this function)
  358 |    if (rtw_napi_gro_receive(&padapter->napi, pskb) != GRO_DROP)
      |                                                       ^~~~~~~~
/var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/recv_linux.c:358:55: note: each undeclared identifier is reported only once for each function it appears in
make[2]: * [scripts/Makefile.build:281: /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/os_dep/linux/recv_linux.o] Error 1
make[2]: * Waiting for unfinished jobs....
make[1]: * [Makefile:1879: /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.13.0-44-generic'
make: * [Makefile:2244: modules] Error 2

编辑4: sudo dkms remove rtl8821ce/v5.5.2_34066.20200325 –all 的结果

    Warning: I do not know how to handle –all.
Error! Invalid number of parameters passed.
Usage: remove <module>/<module-version> --all
   or: remove <module>/<module-version> -k <kernel-version>

git pull的结果

fatal: not a git repository (or any of the parent directories): .git

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.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
'make' -j8 KVER=5.15.0-41-generic......(bad exit status: 2)
ERROR (dkms apport): binary package for rtl8821ce: v5.5.2_34066.20200325 not found
Error! Bad return status for module build on kernel: 5.15.0-41-generic (x86_64)
Consult /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/make.log for more information.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
'make' -j8 KVER=5.15.0-41-generic......(bad exit status: 2)
ERROR (dkms apport): binary package for rtl8821ce: v5.5.2_34066.20200325 not found
Error! Bad return status for module build on kernel: 5.15.0-41-generic (x86_64)
Consult /var/lib/dkms/rtl8821ce/v5.5.2_34066.20200325/build/make.log for more information.
Finished running dkms install steps.

答案1

当需要下载驱动程序以使无线或其他设备正常工作时,有两种常见的方法来安装驱动程序。确切的方法通常在下载的驱动程序中包含的 README 中描述。

第一种方法,一般是:

cd ~/Downloads/<downloaded_driver_file>
make
sudo make install

make install 仅安装当前正在运行的内核的驱动程序;即编译时所针对的内核版本。这意味着,正如您所发现的,每次内核版本更新时,例如从 5.15.0-27 到 5.15.0-28,在请求的重新启动后,驱动程序不再起作用,必须针对新内核版本重新编译。

第二种也是首选的方法是使用 DKMS 或动态内核模块支持。DKMS 会自动重新编译并重新安装,无需用户执行任何额外步骤。典型流程如下:

sudo apt update
sudo apt install dkms
cd ~/Downloads/<downloaded_driver_file>
sudo ./dkms-install.sh 

但是,驱动程序包必须专门编写才能使用 dkms 进程并包含 dkms.conf 文件。同样,该进程将在随附的 README 中清楚地概述。以下是一个例子:

Debian/Ubuntu:sudo apt-get install dkms 要利用知识管理系统该项目的功能,只需运行:``` ./dkms-install.sh

您的问题是:

我无法从终端提供更多信息,因为我谈论的笔记本电脑是朋友的,我们通过电话解决了这个问题。

如果没有具体信息,我们将无法提供具体说明。如果您能够收集一些数据,我们希望查看是否有 dkms 版本的驱动程序。要知道这一点,我们希望知道这是 PCI 内部无线设备还是 USB 设备。如果是 PCI,我们希望查看:

lspci -nnk | grep 0280 -A3

如果是 USB,我们需要:

lsusb

有了这些信息,我们会寻找 dkms 版本的驱动程序,以便自动重新编译和重新安装。

如果没有更多信息,我们无法提出解决方案。

编辑:根据您提供的进一步信息,我建议您安装 dkms 版本的驱动程序:

sudo apt-get install --reinstall git dkms build-essential linux-headers-generic
git clone https://github.com/tomaspinho/rtl8821ce
cd rtl8821ce
chmod +x dkms-install.sh
chmod +x dkms-remove.sh
sudo ./dkms-install.sh

将当前驱动程序列入黑名单:

sudo -i
echo “blacklist rtl8821ce”  >>  /etc/modprobe.d/blacklist.conf
echo “blacklist rtW88_8821ce”  >>  /etc/modprobe.d/blacklist.conf
exit

重启。一切就绪。

编辑2:我注意到代码在最近几天进行了修改。请执行以下操作:

sudo dkms remove rtl8821ce/v5.5.2_34066.20200325 --all
cd rtl8821ce
make clean
git pull
sudo ./dkms-install.sh

重新启动并告诉我们是否有任何改进。

相关内容