升级到内核 5.12 后 DKMS 模块安装错误

升级到内核 5.12 后 DKMS 模块安装错误

升级到内核 5.12.0-051200rc7-generic 后,每次我尝试安装某些升级时都会收到以下错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up rtl8821ce-dkms (5.5.2.1-0ubuntu4) ...
Removing old rtl8821ce-5.5.2.1 DKMS files...

------------------------------
Deleting module version: 5.5.2.1
completely from the DKMS tree.
------------------------------
Done.
Loading new rtl8821ce-5.5.2.1 DKMS files...
Building for 5.12.0-051200rc7-generic
Building initial module for 5.12.0-051200rc7-generic
ERROR (dkms apport): kernel package linux-headers-5.12.0-051200rc7-generic is no
t supported
Error! Bad return status for module build on kernel: 5.12.0-051200rc7-generic (x
86_64)
Consult /var/lib/dkms/rtl8821ce/5.5.2.1/build/make.log for more information.
dpkg: error processing package rtl8821ce-dkms (--configure):
 installed rtl8821ce-dkms package post-installation script subprocess returned e
rror exit status 10
Setting up rtk-btusb-dkms (5.0.0.3-0~201906251524~ubuntu19.10.1) ...
Removing old rtk-btusb-5.0.0.3 DKMS files...

------------------------------
Deleting module version: 5.0.0.3
completely from the DKMS tree.
------------------------------
Done.
Loading new rtk-btusb-5.0.0.3 DKMS files...
Building for 5.12.0-051200rc7-generic
Building initial module for 5.12.0-051200rc7-generic
ERROR (dkms apport): kernel package linux-headers-5.12.0-051200rc7-generic is no
t supported
Error! Bad return status for module build on kernel: 5.12.0-051200rc7-generic (x
86_64)
Consult /var/lib/dkms/rtk-btusb/5.0.0.3/build/make.log for more information.
dpkg: error processing package rtk-btusb-dkms (--configure):
 installed rtk-btusb-dkms package post-installation script subprocess returned e
rror exit status 10
Errors were encountered while processing:
 rtl8821ce-dkms
 rtk-btusb-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)

dkms 包的状态是:

$ dkms status
evdi, 1.7.0, 5.6.0-1042-oem, x86_64: installed
nvidia, 460.67, 5.11.0-7612-generic, x86_64: installed
nvidia, 460.67, 5.11.15-xanmod1, x86_64: installed
nvidia, 460.67, 5.12.0-051200rc7-generic, x86_64: installed
rtk-btusb, 5.0.0.3: added
rtl8821ce, 5.5.2.1: added
system76, 1.0.12~1616424713~20.10~c42d494, 5.11.0-7612-generic, x86_64: installed
system76, 1.0.12~1616424713~20.10~c42d494, 5.11.15-xanmod1, x86_64: installed
system76, 1.0.12~1616424713~20.10~c42d494, 5.12.0-051200rc7-generic, x86_64: installed
system76_acpi, 1.0.2~1600812457~20.10~0bc966c, 5.11.0-7612-generic, x86_64: installed (original_module exists)
system76_acpi, 1.0.2~1600812457~20.10~0bc966c, 5.11.15-xanmod1, x86_64: installed (original_module exists)
system76_acpi, 1.0.2~1600812457~20.10~0bc966c, 5.12.0-051200rc7-generic, x86_64: installed (original_module exists)
system76-io, 1.0.1~1616424744~20.10~57c15ff, 5.11.0-7612-generic, x86_64: installed
system76-io, 1.0.1~1616424744~20.10~57c15ff, 5.11.15-xanmod1, x86_64: installed
system76-io, 1.0.1~1616424744~20.10~57c15ff, 5.12.0-051200rc7-generic, x86_64: installed

我怎样才能完全删除这些包或者正确更新它们?

谢谢。

答案1

删除处于“半配置”状态的软件包通常需要放弃使用 apt(一种高级或“智能”软件包管理器),而使用 apt 在后台使用的更强大的后端工具 dpkg。直接调用 dpkg 时应始终小心谨慎,因为使用它很可能会使情况变得更糟;这是因为它通常会尽一切可能按照指示去做,而 apt 或 aptitude 等工具则相反,如果您指示它们做一些不明智的事情,它们会反击,有时甚至会直接拒绝合作。

您所述的目标只是删除导致问题的软件包,因此这很简单,我很乐意建议您直接使用 dpkg。最好使用它的“purge”命令,该命令将卸载所有软件包的痕迹。此调用应导致两个有问题的软件包都被清除:

sudo dpkg -P rtl8821ce-dkms rtk-btusb-dkms

简单介绍一下,我认为 rtl8821ce 内核模块可能无法为 5.12 Linux 内核构建,因为该驱动程序最终在上一个合并窗口(针对内核 5.11)期间被接受成为内核的一部分,因此应该已经存在于您使用的内核中。我还没有去查看是否确实如此,但几个月前我才意识到这一点。我无法解释为什么另一个可能无法构建,我没有亲身经历或了解它。

答案2

尝试重建内核 它对我有用,但我在这上面呆了两天:')

sudo apt install --reinstall linux-headers-$(uname -r)       

sudo apt install --reinstall build-essential
sudo apt install --reinstall dkms                                                    
sudo apt install --reinstall linux-generic
sudo apt install --reinstall linux-signed-generic

这个可能不起作用,但是没关系:)

sudo apt install --reinstall linux-signed-generic

然后安装最新版本的 gcc

sudo apt install gcc

对于像我这样必须使用 RTX3050 的人来说,这个问题还修复了 Nvidia 驱动程序安装:')

另外,删除 dkms 中的问题包也应该有效。然后尝试重新安装

sudo dkms -P PACKAGE_NAME

相关内容