处理时遇到错误: linux-headers-6.1.0-kali5-amd64 linux-image-6.1.0-kali5-amd64 linux-headers-amd64 linux-image-amd64?

处理时遇到错误: linux-headers-6.1.0-kali5-amd64 linux-image-6.1.0-kali5-amd64 linux-headers-amd64 linux-image-amd64?

Kali 不会让我完全升级。我尝试时得到的错误是:

Building module:
Cleaning build area...
make -j2 KERNELRELEASE=6.1.0-kali5-amd64 -C /lib/modules/6.1.0-kali5-amd64/build M=/var/lib/dkms/virtualbox-guest/6.1.12/build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.1.0-kali5-amd64 (x86_64)
Consult /var/lib/dkms/virtualbox-guest/6.1.12/build/make.log for more information.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
 failed!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
dpkg: error processing package linux-image-6.1.0-kali5-amd64 (--configure):
 installed linux-image-6.1.0-kali5-amd64 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-headers-amd64:
 linux-headers-amd64 depends on linux-headers-6.1.0-kali5-amd64 (= 6.1.12-1kali2); however:
  Package linux-headers-6.1.0-kali5-amd64 is not configured yet.

dpkg: error processing package linux-headers-amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-amd64:
 linux-image-amd64 depends on linux-image-6.1.0-kali5-amd64 (= 6.1.12-1kali2); however:
  Package linux-image-6.1.0-kali5-amd64 is not configured yet.

dpkg: error processing package linux-image-amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-headers-6.1.0-kali5-amd64
 linux-image-6.1.0-kali5-amd64
 linux-headers-amd64
 linux-image-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

我检查了 make.log 文件并看到了以下内容:

DKMS make.log for virtualbox-guest-6.1.12 for kernel 6.1.0-kali5-amd64 (x86_64)
Tue Mar 14 10:45:27 AM EDT 2023
make: Entering directory '/usr/src/linux-headers-6.1.0-kali5-amd64'
  CC [M]  /var/lib/dkms/virtualbox-guest/6.1.12/build/vboxguest/VBoxGuest-linux.o
  CC [M]  /var/lib/dkms/virtualbox-guest/6.1.12/build/vboxguest/VBoxGuest.o
In file included from /var/lib/dkms/virtualbox-guest/6.1.12/build/vboxguest/include/iprt/types.h:34,
                 from /var/lib/dkms/virtualbox-guest/6.1.12/build/vboxguest/r0drv/linux/the-linux-kernel.h:37,
                 from /var/lib/dkms/virtualbox-guest/6.1.12/build/vboxguest/VBoxGuest-linux.c:36:
/var/lib/dkms/virtualbox-guest/6.1.12/build/vboxguest/include/iprt/stdarg.h:47:12: fatal error: stdarg.h: No such file or directory
   47 | #  include <stdarg.h>
      |            ^~~~~~~~~~
compilation terminated.
In file included from /var/lib/dkms/virtualbox-guest/6.1.12/build/vboxguest/include/iprt/types.h:34,
                 from /var/lib/dkms/virtualbox-guest/6.1.12/build/vboxguest/VBoxGuestInternal.h:33,
                 from /var/lib/dkms/virtualbox-guest/6.1.12/build/vboxguest/VBoxGuest.c:54:
/var/lib/dkms/virtualbox-guest/6.1.12/build/vboxguest/include/iprt/stdarg.h:47:12: fatal error: stdarg.h: No such file or directory
   47 | #  include <stdarg.h>
      |            ^~~~~~~~~~
compilation terminated.
make[2]: *** [/usr/src/linux-headers-6.1.0-kali5-common/scripts/Makefile.build:255: /var/lib/dkms/virtualbox-guest/6.1.12/build/vboxguest/VBoxGuest-linux.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [/usr/src/linux-headers-6.1.0-kali5-common/scripts/Makefile.build:255: /var/lib/dkms/virtualbox-guest/6.1.12/build/vboxguest/VBoxGuest.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.1.0-kali5-common/scripts/Makefile.build:505: /var/lib/dkms/virtualbox-guest/6.1.12/build/vboxguest] Error 2
make: *** [/usr/src/linux-headers-6.1.0-kali5-common/Makefile:2030: /var/lib/dkms/virtualbox-guest/6.1.12/build] Error 2
make: Leaving directory '/usr/src/linux-headers-6.1.0-kali5-amd64

这是一个 VirtualBox 虚拟机。我在用sudo apt full-upgrade -y。我正在尝试升级到 Kali Purple,即 6.1.0-kali5-amd64

更新:尝试安装缺少的 stdarg.hsudo apt-get install libc6-dev但它输出相同的 dpkg 错误

答案1

我正在运行 VMWare,但遇到了同样的问题。

免责声明

我不知道您是否需要 aufs-dkms,因此我建议在执行以下步骤之前先拍摄快照。

首先,启动到以前的内核版本。然后,我能够用以下方法修复它:

sudo apt remove aufs-dkms
sudo apt autoremove
sudo apt update && sudo apt dist-upgrade -y

经过这些步骤后,我能够重新启动到新内核。

答案2

你的virtualbox-guest是6.1.12版本,已经发布了回到 2020 年 7 月- 当时,6.x 内核系列还不存在。

难怪 DKMS 无法virtualbox-guest为该内核构建模块!

为了支持 Linux 6.1.x 内核系列,您需要首先将 VirtualBox 更新到至少版本6.1.42(= 在撰写本文时最新的 VirtualBox 6.1 系列版本)或7.0.2(= 添加了 Linux 6.1 内核系列支持的 VirtualBox 7.0.x 系列版本)。

完成此操作后,您必须更新虚拟机中的 VirtualBox Guest 工具,只有在此之后您才可以重新运行 Kali 更新。

相关内容