dpkg:处理软件包 virtualbox-dkms (--configure) 时出错:

dpkg:处理软件包 virtualbox-dkms (--configure) 时出错:

我正在尝试运行 VirtualBox,但它无法正常工作。尝试重新安装它,但遇到了错误。

sudo apt purge virtualbox
[sudo] password for vega: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'virtualbox' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up virtualbox-dkms (6.1.32-dfsg-1build1) ...
Removing old virtualbox-6.1.32 DKMS files...
Deleting module virtualbox-6.1.32 completely from the DKMS tree.
Loading new virtualbox-6.1.32 DKMS files...
Building for 5.19.0-38-generic
Building initial module for 5.19.0-38-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash'
Error! Bad return status for module build on kernel: 5.19.0-38-generic (x86_64)
Consult /var/lib/dkms/virtualbox/6.1.32/build/make.log for more information.
dpkg: error processing package virtualbox-dkms (--configure):
 installed virtualbox-dkms package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
 virtualbox-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)

我想重新安装 VirtualBox 并让它再次运行

添加了额外信息:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:    22.04
Codename:   jammy
$ dkms status
virtualbox/6.1.32: added
$ dpkg -l | egrep linux-'[g|i|h|m]'
ii  binutils-x86-64-linux-gnu                  2.38-4ubuntu2.1                         amd64        GNU binary utilities, for x86-64-linux-gnu target
ii  linux-generic-hwe-22.04                    5.19.0.38.39~22.04.12                   amd64        Complete Generic Linux kernel and headers
ii  linux-headers-5.19.0-35-generic            5.19.0-35.36~22.04.1                    amd64        Linux kernel headers for version 5.19.0 on 64 bit x86 SMP
ii  linux-headers-5.19.0-38-generic            5.19.0-38.39~22.04.1                    amd64        Linux kernel headers for version 5.19.0 on 64 bit x86 SMP
ii  linux-headers-5.4.60-050460                5.4.60-050460.202008210836              all          Header files related to Linux kernel version 5.4.60
ii  linux-headers-generic-hwe-22.04            5.19.0.38.39~22.04.12                   amd64        Generic Linux kernel headers
ii  linux-hwe-5.19-headers-5.19.0-35           5.19.0-35.36~22.04.1                    all          Header files related to Linux kernel version 5.19.0
ii  linux-hwe-5.19-headers-5.19.0-38           5.19.0-38.39~22.04.1                    all          Header files related to Linux kernel version 5.19.0
rc  linux-image-5.19.0-32-generic              5.19.0-32.33~22.04.1                    amd64        Signed kernel image generic
ii  linux-image-5.19.0-35-generic              5.19.0-35.36~22.04.1                    amd64        Signed kernel image generic
ii  linux-image-5.19.0-38-generic              5.19.0-38.39~22.04.1                    amd64        Signed kernel image generic
ii  linux-image-generic-hwe-22.04              5.19.0.38.39~22.04.12                   amd64        Generic Linux kernel image
ii  linux-image-unsigned-5.4.60-050460-generic 5.4.60-050460.202008210836              amd64        Linux kernel image for version 5.4.60 on 64 bit x86 SMP
rc  linux-modules-5.19.0-32-generic            5.19.0-32.33~22.04.1                    amd64        Linux kernel extra modules for version 5.19.0 on 64 bit x86 SMP
ii  linux-modules-5.19.0-35-generic            5.19.0-35.36~22.04.1                    amd64        Linux kernel extra modules for version 5.19.0 on 64 bit x86 SMP
ii  linux-modules-5.19.0-38-generic            5.19.0-38.39~22.04.1                    amd64        Linux kernel extra modules for version 5.19.0 on 64 bit x86 SMP
ii  linux-modules-5.4.60-050460-generic        5.4.60-050460.202008210836              amd64        Linux kernel extra modules for version 5.4.60 on 64 bit x86 SMP
rc  linux-modules-extra-5.19.0-32-generic      5.19.0-32.33~22.04.1                    amd64        Linux kernel extra modules for version 5.19.0 on 64 bit x86 SMP
ii  linux-modules-extra-5.19.0-35-generic      5.19.0-35.36~22.04.1                    amd64        Linux kernel extra modules for version 5.19.0 on 64 bit x86 SMP
ii  linux-modules-extra-5.19.0-38-generic      5.19.0-38.39~22.04.1                    amd64        Linux kernel extra modules for version 5.19.0 on 64 bit x86 SMP
$ uname -r 
5.19.0-38-generic
$ dpkg -l | egrep linux-'[g|i|h|m]'
ii  binutils-x86-64-linux-gnu                  2.38-4ubuntu2.1                         amd64        GNU binary utilities, for x86-64-linux-gnu target
ii  linux-generic-hwe-22.04                    5.19.0.38.39~22.04.12                   amd64        Complete Generic Linux kernel and headers
ii  linux-headers-5.19.0-35-generic            5.19.0-35.36~22.04.1                    amd64        Linux kernel headers for version 5.19.0 on 64 bit x86 SMP
ii  linux-headers-5.19.0-38-generic            5.19.0-38.39~22.04.1                    amd64        Linux kernel headers for version 5.19.0 on 64 bit x86 SMP
ii  linux-headers-5.4.60-050460                5.4.60-050460.202008210836              all          Header files related to Linux kernel version 5.4.60
ii  linux-headers-generic-hwe-22.04            5.19.0.38.39~22.04.12                   amd64        Generic Linux kernel headers
ii  linux-hwe-5.19-headers-5.19.0-35           5.19.0-35.36~22.04.1                    all          Header files related to Linux kernel version 5.19.0
ii  linux-hwe-5.19-headers-5.19.0-38           5.19.0-38.39~22.04.1                    all          Header files related to Linux kernel version 5.19.0
rc  linux-image-5.19.0-32-generic              5.19.0-32.33~22.04.1                    amd64        Signed kernel image generic
ii  linux-image-5.19.0-35-generic              5.19.0-35.36~22.04.1                    amd64        Signed kernel image generic
ii  linux-image-5.19.0-38-generic              5.19.0-38.39~22.04.1                    amd64        Signed kernel image generic
ii  linux-image-generic-hwe-22.04              5.19.0.38.39~22.04.12                   amd64        Generic Linux kernel image
ii  linux-image-unsigned-5.4.60-050460-generic 5.4.60-050460.202008210836              amd64        Linux kernel image for version 5.4.60 on 64 bit x86 SMP
rc  linux-modules-5.19.0-32-generic            5.19.0-32.33~22.04.1                    amd64        Linux kernel extra modules for version 5.19.0 on 64 bit x86 SMP
ii  linux-modules-5.19.0-35-generic            5.19.0-35.36~22.04.1                    amd64        Linux kernel extra modules for version 5.19.0 on 64 bit x86 SMP
ii  linux-modules-5.19.0-38-generic            5.19.0-38.39~22.04.1                    amd64        Linux kernel extra modules for version 5.19.0 on 64 bit x86 SMP
ii  linux-modules-5.4.60-050460-generic        5.4.60-050460.202008210836              amd64        Linux kernel extra modules for version 5.4.60 on 64 bit x86 SMP
rc  linux-modules-extra-5.19.0-32-generic      5.19.0-32.33~22.04.1                    amd64        Linux kernel extra modules for version 5.19.0 on 64 bit x86 SMP
ii  linux-modules-extra-5.19.0-35-generic      5.19.0-35.36~22.04.1                    amd64        Linux kernel extra modules for version 5.19.0 on 64 bit x86 SMP
ii  linux-modules-extra-5.19.0-38-generic      5.19.0-38.39~22.04.1                    amd64        Linux kernel extra modules for version 5.19.0 on 64 bit x86 SMP

崩溃文件

$ ❯ cat /var/crash/virtualbox-dkms.0.crash
ProblemType: Package
DKMSBuildLog:
 DKMS make.log for virtualbox-6.1.32 for kernel 5.19.0-38-generic (x86_64)
 Saturday 01 April 2023 06:33:04 PM IST
 make: Entering directory '/usr/src/linux-headers-5.19.0-38-generic'
 warning: the compiler differs from the one used to build the kernel
   The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
   You are using:           gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/linux/SUPDrv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/SUPDrv.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/SUPDrvGip.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/SUPDrvSem.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/SUPDrvTracer.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/SUPLibAll.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/alloc-r0drv.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/initterm-r0drv.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/memobj-r0drv.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/mpnotification-r0drv.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/powernotification-r0drv.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/assert-r0drv-linux.o
 /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/SUPDrvTracer.o: warning: objtool: SUPR0TracerFireProbe+0x7: indirect jump found in RETPOLINE build
 /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/SUPDrvTracer.o: warning: objtool: supdrvTracerProbeFireStub+0x0: 'naked' return found in RETHUNK build
 /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/SUPDrvTracer.o: warning: objtool: SUPR0TracerFireProbe+0x7: missing int3 after indirect jump
 /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/SUPDrvTracer.o: warning: objtool: supdrvTracerProbeFireStub+0x0: missing int3 after ret
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/initterm-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/mp-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/mpnotification-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/process-r0drv-linux.o
 In file included from ./include/linux/string.h:253,
                  from /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/include/iprt/string.h:39,
                  from /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/SUPDrvInternal.h:46,
                  from /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/SUPDrv.c:33:
 In function ‘fortify_memcpy_chk’,
     inlined from ‘supdrvIOCtlInnerUnrestricted’ at /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/SUPDrv.c:1745:13,
     inlined from ‘supdrvIOCtl’ at /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/SUPDrv.c:2697:14:
 ./include/linux/fortify-string.h:345:25: warning: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning]
   345 |                         __write_overflow_field(p_size_field, size);
       |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/rtStrFormatKernelAddress-r0drv-linux.o
 /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o: warning: objtool: VBoxHost_RTR0MemKernelCopyTo+0x13: redundant CLD
 /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o: warning: objtool: VBoxHost_RTR0MemKernelCopyFrom+0x13: redundant CLD
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/semevent-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/semeventmulti-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/semfastmutex-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/semmutex-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/spinlock-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/thread-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/thread2-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/threadctxhooks-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/time-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/timer-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/generic/semspinmutex-r0drv-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/alloc/alloc.o
 /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/threadctxhooks-r0drv-linux.o: warning: objtool: rtThreadCtxHooksLnxSchedOut+0x1f: call to {dynamic}() with UACCESS enabled
 /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/threadctxhooks-r0drv-linux.o: warning: objtool: rtThreadCtxHooksLnxSchedIn+0x29: call to {dynamic}() with UACCESS enabled
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/checksum/crc32.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/checksum/ipv4.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/checksum/ipv6.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/err/RTErrConvertFromErrno.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/err/RTErrConvertToErrno.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/err/errinfo.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/log/log.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/log/logellipsis.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/log/logrel.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/log/logrelellipsis.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/log/logcom.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/log/logformat.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/misc/RTAssertMsg1Weak.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/misc/RTAssertMsg2.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/misc/RTAssertMsg2Add.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/misc/RTAssertMsg2AddWeak.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/misc/RTAssertMsg2AddWeakV.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/misc/RTAssertMsg2Weak.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/misc/RTAssertMsg2WeakV.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/misc/assert.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/misc/handletable.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/misc/handletablectx.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/misc/thread.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/RTStrCat.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/RTStrCopy.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/RTStrCopyEx.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/RTStrCopyP.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/RTStrNCmp.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/RTStrNLen.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/stringalloc.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/strformat.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/RTStrFormat.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/strformatnum.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/strformatrt.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/strformattype.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/strprintf.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/strprintf-ellipsis.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/string/strtonum.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/table/avlpv.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/time/time.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/r0drv/linux/RTLogWriteDebugger-r0drv-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/generic/RTAssertShouldPanic-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/generic/RTLogWriteStdErr-stub-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/generic/RTLogWriteStdOut-stub-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/generic/RTLogWriteUser-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/generic/RTMpGetArraySize-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/generic/RTMpGetCoreCount-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/generic/RTSemEventWait-2-ex-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/generic/RTSemEventWaitNoResume-2-ex-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/generic/RTSemEventMultiWait-2-ex-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/generic/RTSemEventMultiWaitNoResume-2-ex-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/generic/RTTimerCreate-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/generic/errvars-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/generic/mppresent-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/generic/uuid-generic.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/VBox/log-vbox.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/common/alloc/heapsimple.o
   LD [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxdrv/vboxdrv.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxnetflt/linux/VBoxNetFlt-linux.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxnetflt/VBoxNetFlt.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxnetflt/SUPR0IdcClient.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxnetflt/SUPR0IdcClientComponent.o
   CC [M]  /var/lib/dkms/virtualbox/6.1.32/build/vboxnetflt/linux/SUPR0IdcClient-linux.o
 /var/lib/dkms/virtualbox/6.1.32/build/vboxnetflt/linux/VBoxNetFlt-linux.c: In function ‘vboxNetFltPortOsXmit’:
 /var/lib/dkms/virtualbox/6.1.32/build/vboxnetflt/linux/VBoxNetFlt-linux.c:2314:23: error: implicit declaration of function ‘netif_rx_ni’; did you mean ‘netif_rx’? [-Werror=implicit-function-declaration]
  2314 |                 err = netif_rx_ni(pBuf);
       |                       ^~~~~~~~~~~
       |                       netif_rx
 cc1: some warnings being treated as errors
 make[2]: *** [scripts/Makefile.build:257: /var/lib/dkms/virtualbox/6.1.32/build/vboxnetflt/linux/VBoxNetFlt-linux.o] Error 1
 make[1]: *** [scripts/Makefile.build:474: /var/lib/dkms/virtualbox/6.1.32/build/vboxnetflt] Error 2
 make: *** [Makefile:1850: /var/lib/dkms/virtualbox/6.1.32/build] Error 2
 make: Leaving directory '/usr/src/linux-headers-5.19.0-38-generic'
DKMSKernelVersion: 5.19.0-38-generic
Date: Sat Apr  1 18:33:19 2023
DuplicateSignature: dkms:virtualbox-dkms:6.1.32-dfsg-1build1:/var/lib/dkms/virtualbox/6.1.32/build/vboxnetflt/linux/VBoxNetFlt-linux.c:2314:23: error: implicit declaration of function ‘netif_rx_ni’; did you mean ‘netif_rx’? [-Werror=implicit-function-declaration]
Package: virtualbox-dkms 6.1.32-dfsg-1build1
PackageVersion: 6.1.32-dfsg-1build1
SourcePackage: virtualbox
Title: virtualbox-dkms 6.1.32-dfsg-1build1: virtualbox kernel module failed to build


sudo dpkg -P linux-image-unsigned-5.4.60-050460-generic
[sudo] password for vega: 
(Reading database ... 232440 files and directories currently installed.)
Removing linux-image-unsigned-5.4.60-050460-generic (5.4.60-050460.202008210836) ...
I: /boot/vmlinuz.old is now a symlink to vmlinuz-5.19.0-35-generic
I: /boot/initrd.img.old is now a symlink to initrd.img-5.19.0-35-generic
I: /boot/vmlinuz is now a symlink to vmlinuz-5.19.0-38-generic
I: /boot/initrd.img is now a symlink to initrd.img-5.19.0-38-generic
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.4.60-050460-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.19.0-38-generic
Found initrd image: /boot/initrd.img-5.19.0-38-generic
Found linux image: /boot/vmlinuz-5.19.0-35-generic
Found initrd image: /boot/initrd.img-5.19.0-35-generic
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...
done
Purging configuration files for linux-image-unsigned-5.4.60-050460-generic (5.4.60-050460.202008210836) ...
rmdir: failed to remove '/lib/modules/5.4.60-050460-generic': Directory not empty
apt-cache policy virtualbox
virtualbox:
  Installed: (none)
  Candidate: 6.1.32-dfsg-1build1
  Version table:
     6.1.32-dfsg-1build1 500
        500 https://mirror.kku.ac.th/ubuntu jammy/multiverse amd64 Packages

答案1

Virtualbox 6.1.32 的当前问题:virtualbox-kernel (6.1.32) sbo 无法在 -current 上构建。有些帖子讨论了使用 slakware 和 virtualbox 6.1.32 补丁进行修复。但我想安装 virtualbox 7.0.6 版本来解决这个问题。

请使用命令删除 Virutalbox 和 virtualbox-dkms 包。

  • sudo dkms 删除 virtualbox/6.1.32 --all
  • sudo dpkg -P virtualbox virtualbox-dkms

Virtualbox 7.0.6 版本可在此处获取。[https://www.virtualbox.org/wiki/Linux_Downloads]

  • 下载适用于 22.04 的 virutualbox。(virtualbox-7.0_7.0.6-155176~Ubuntu~jammy_amd64.deb)
  • 使用本地路径安装。(例如:sudo apt install .//virtualbox-7.0_7.0.6-155176~Ubuntu~jammy_amd64.deb)

答案2

sudo dkms remove virtualbox/6.1.32 --all这将从系统的所有内核中删除 virtualbox 模块。它永远不会在您的系统上构建。

sudo apt purge virtualbox好的,那不工作

sudo dpkg -P virtualbox virtualbox-dkms

确保您的系统上启用了 jammy-updates。 如何恢复默认存储库

sudo apt update(这必须无错误地运行!)

sudo apt install virtualbox

相关内容