我正在尝试在 Ubuntu 22.04 上安装 VirtualBox。
我下载了正确的.deb从官方网站安装并sudo dpkg -i virtualbox-7.0_7.0.12-159484\~Ubuntu\~jammy_amd64.deb
给出以下信息:
Wybieranie wcześniej niewybranego pakietu virtualbox-7.0.
(Odczytywanie bazy danych ... 357166 plików i katalogów obecnie zainstalowanych.)
Przygotowywanie do rozpakowania pakietu virtualbox-7.0_7.0.12-159484~Ubuntu~jammy_amd64.deb ...
Rozpakowywanie pakietu virtualbox-7.0 (7.0.12-159484~Ubuntu~jammy) ...
Konfigurowanie pakietu virtualbox-7.0 (7.0.12-159484~Ubuntu~jammy) ...
Dodawanie grupy "vboxusers" (GID 141)...
Gotowe.
vboxdrv.sh: failed: Look at /var/log/vbox-setup.log to find out what went wrong.
There were problems setting up VirtualBox. To re-start the set-up process, run
/sbin/vboxconfig
as root. If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.
Przetwarzanie wyzwalaczy pakietu mailcap (3.70+nmu1ubuntu1)...
Przetwarzanie wyzwalaczy pakietu gnome-menus (3.36.0-1ubuntu3)...
Przetwarzanie wyzwalaczy pakietu desktop-file-utils (0.26-1ubuntu3)...
Przetwarzanie wyzwalaczy pakietu hicolor-icon-theme (0.17-2)...
Przetwarzanie wyzwalaczy pakietu shared-mime-info (2.1-2)...
同样的情况也发生在sudo apt install virtualbox
。
它是波兰语的,但相关部分是vboxdrv.sh: failed: Look at /var/log/vbox-setup.log to find out what went wrong
。该文件显示:
Building the main VirtualBox module.
Error building the module:
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/6.4.10-060410-generic/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j16 modules
make[1]: uwaga: -j16 wymuszone w podzadaniu: wyłączanie trybu serwera zadań.
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-1ubuntu1) 13.2.0
You are using:
make -f ./scripts/Makefile.build obj=/tmp/vbox.0 need-builtin=1 need-modorder=1
# cmd_mod /tmp/vbox.0/vboxdrv.mod
printf '%s
' linux/SUPDrv-linux.o SUPDrv.o SUPDrvGip.o SUPDrvSem.o SUPDrvTracer.o SUPLibAll.o common/string/strformatrt.o combined-agnostic1.o combined-agnostic2.o combined-os-specific.o | awk '!x[$0]++ { print("/tmp/vbox.0/"$0) }' > /tmp/vbox.0/vboxdrv.mod
# CC [M] /tmp/vbox.0/linux/SUPDrv-linux.o
gcc-13 -Wp,-MMD,/tmp/vbox.0/linux/.SUPDrv-linux.o.d -nostdinc -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -funsigned-char -std=gnu11 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -mno-80387 -mtune=generic -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mfunction-return=thunk-extern -fno-jump-tables -mharden-sls=all -fpatchable-function-entry=16,16 -fno-delete-null-pointer-checks -O2 -Wframe-larger-than=1024 -fstack-protector-strong -Wno-main -fno-omit-frame-pointer -fno-optimize-sibling-calls -ftrivial-auto-var-init=zero -fzero-call-used-regs=used-gpr -pg -mrecord-mcount -falign-functions=16 -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-maybe-uninitialized -Wno-array-bounds -Wno-alloc-size-larger-than -Wimplicit-fallthrough=5 -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -g -gdwarf-5 -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h -fno-omit-frame-pointer -fno-pie -Wno-declaration-after-statement -I./include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX_WITHOUT_EFLAGS_AC_SET_IN_VBOXDRV -DIPRT_WITHOUT_EFLAGS_AC_PRESERVING -DVBOX_WITH_64_BITS_GUESTS -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_AMD64 -fsanitize=bounds -fsanitize=shift -fsanitize=bool -fsanitize=enum -DMODULE -DKBUILD_BASENAME='"SUPDrv_linux"' -DKBUILD_MODNAME='"vboxdrv"' -D__KBUILD_MODNAME=kmod_vboxdrv -c -o /tmp/vbox.0/linux/SUPDrv-linux.o /tmp/vbox.0/linux/SUPDrv-linux.c ; ./tools/objtool/objtool --hacks=jump_label --hacks=noinstr --hacks=skylake --retpoline --rethunk --sls --stackval --static-call --uaccess --prefix=16 --module /tmp/vbox.0/linux/SUPDrv-linux.o
/bin/sh: 1: gcc-13: not found
make[2]: *** [scripts/Makefile.build:252: /tmp/vbox.0/linux/SUPDrv-linux.o] Błąd 127
make[1]: *** [Makefile:2038: /tmp/vbox.0] Błąd 2
make: *** [/tmp/vbox.0/Makefile-footer.gmk:133: vboxdrv] Błąd 2
明确指出gcc-13: not found
。但sudo apt install gcc-13
给出
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gcc-13
也一样gcc13
。
我该如何安装gcc-13
?还是我在安装 VirtualBox 时做错了什么?
答案1
为什么您更喜欢手动安装 VirtualBox 而不是使用apt
?
从 Ubuntu 存储库安装 VirtualBox:
sudo apt install virtualbox
在 Ubuntu 22.04 上安装 gcc-13:
在 Ubuntu 22.04 上安装 gcc-13 可能有点棘手,因为该软件包不是 22.04 的一部分。因此,您必须使用ppa:ubuntu-toolchain-r/test
repo,或者自己构建软件包。
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-13