为 Manjaro/Arch/pacman 安装的 virtualbox(内核)不正确

为 Manjaro/Arch/pacman 安装的 virtualbox(内核)不正确

我用 pacman 在 4.19.2-1-MANJARO 上安装了一个错误的 virtualbox。

这是我的初始安装标准输出:

[gloom@tacos-pc etc]$ sudo pacman -S virtualbox
error: could not register 'multilib' database (database already registered)
resolving dependencies...
:: There are 11 providers available for VIRTUALBOX-HOST-MODULES:
:: Repository extra
   1) linux316-virtualbox-host-modules  2) linux318-virtualbox-host-modules
   3) linux414-virtualbox-host-modules  4) linux419-virtualbox-host-modules
   5) linux420-virtualbox-host-modules  6) linux44-virtualbox-host-modules
   7) linux49-virtualbox-host-modules
:: Repository community
   8) linux414-rt-virtualbox-host-modules
   9) linux416-rt-virtualbox-host-modules
   10) linux418-rt-virtualbox-host-modules  11) virtualbox-host-dkms

Enter a number (default=1): 
looking for conflicting packages...

Packages (3) linux316-3.16.62-1  linux316-virtualbox-host-modules-6.0.2-1
             virtualbox-6.0.2-1

Total Download Size:   117.19 MiB
Total Installed Size:  247.06 MiB

:: Proceed with installation? [Y/n] Y
:: Retrieving packages...
 linux316-3.16.62-1-...    55.6 MiB   598K/s 01:35 [######################] 100%
 linux316-virtualbox...   214.5 KiB   559K/s 00:00 [######################] 100%
 virtualbox-6.0.2-1-...    61.4 MiB   541K/s 01:56 [######################] 100%
(3/3) checking keys in keyring                     [######################] 100%
(3/3) checking package integrity                   [######################] 100%
(3/3) loading package files                        [######################] 100%
(3/3) checking for file conflicts                  [######################] 100%
(3/3) checking available disk space                [######################] 100%
:: Processing package changes...
(1/3) installing linux316                          [######################] 100%
>>> Updating module dependencies. Please wait ...
Optional dependencies for linux316
    crda: to set the correct wireless channels of your country [installed]
(2/3) installing linux316-virtualbox-host-modules  [######################] 100%
===> You must load vboxdrv module before starting VirtualBox:
===> # modprobe vboxdrv
(3/3) installing virtualbox                        [######################] 100%
Optional dependencies for virtualbox
    vde2: Virtual Distributed Ethernet support [installed]
    virtualbox-guest-iso: Guest Additions CD image
    virtualbox-ext-vnc: VNC server support
    virtualbox-sdk: Developer kit
:: Running post-transaction hooks...
( 1/10) Install DKMS modules
( 2/10) Updating linux316 initcpios
==> Building image from preset: /etc/mkinitcpio.d/linux316.preset: 'default'
  -> -k /boot/vmlinuz-3.16-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-3.16-x86_64.img
==> Starting build: 3.16.62-1-MANJARO
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-3.16-x86_64.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux316.preset: 'fallback'
  -> -k /boot/vmlinuz-3.16-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-3.16-x86_64-fallback.img -S autodetect
==> Starting build: 3.16.62-1-MANJARO
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [resume]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-3.16-x86_64-fallback.img
==> Image generation successful
( 3/10) Updating Grub-Bootmenu
Generating grub configuration file ...
Found theme: /usr/share/grub/themes/manjaro/theme.txt
Found linux image: /boot/vmlinuz-4.19-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-4.19-x86_64.img
Found initrd fallback image: /boot/initramfs-4.19-x86_64-fallback.img
Found linux image: /boot/vmlinuz-3.16-x86_64
Found initrd image: /boot/intel-ucode.img /boot/initramfs-3.16-x86_64.img
Found initrd fallback image: /boot/initramfs-3.16-x86_64-fallback.img
Found memtest86+ image: /boot/memtest86+/memtest.bin
done
( 4/10) Updating icon theme caches...
( 5/10) Reloading system manager configuration...
( 6/10) Creating system user accounts...
( 7/10) Reloading device manager configuration...
( 8/10) Arming ConditionNeedsUpdate...
( 9/10) Updating the desktop file MIME type cache...
(10/10) Updating the MIME type database...

我相信这是一个错误的安装,因为当我在安装后尝试运行 virtualbox 时,我收到一条错误消息:

Unloading modules: 
Loading modules: modprobe: FATAL: Module vboxnetadp not found in directory /lib/modules/4.19.2-1-MANJARO
modprobe: FATAL: Module vboxnetflt not found in directory /lib/modules/4.19.2-1-MANJARO
modprobe: FATAL: Module vboxpci not found in directory /lib/modules/4.19.2-1-MANJARO
modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.19.2-1-MANJARO

我按照此处列出的说明进行操作:https://wiki.manjaro.org/index.php?title=VirtualBox#Install_VirtualBox我选择了默认内核选项(安装过程中的第一个提示),而不是根据我的 manjaro 安装来选择一个linux*-virtualbox-host-modules

然后我尝试使用卸载virtualbox packman -Rs virtualbox。但是,当我尝试重新启动时,没有提示我选择我的linux*-virtualbox-host-modules版本。当我尝试再次安装时,它默认为virtualbox-6.0.2-1.显然我不擅长安装东西。然后我移到linux${wrong}-virtualbox-host-modules一边并再次尝试安装...它没有提示我输入版本号,但我还是让安装了。

当我尝试运行第二次安装时,出现以下错误:

WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (4.19.2-1-MANJARO) or it failed to
         load. Please recompile the kernel module and install it by

           sudo /sbin/vboxconfig

         You will not be able to start VMs until this problem is fixed.
/usr/lib/virtualbox/VirtualBox: /usr/lib/libQt5Core.so.5: version `Qt_5.12' not found (required by /usr/lib/virtualbox/VirtualBox)
/usr/lib/virtualbox/VirtualBox: /usr/lib/libQt5Core.so.5: version `Qt_5.12' not found (required by /usr/lib/virtualbox/VBoxGlobal.so)

然后我尝试pacman -S linux419-virtualbox-host-modules并成功运行,但仍然有错误。

我该如何解决?

答案1

我通过递归删除该virtualbox-host-modules包解决了这个问题,这也删除了其他包。

您可以通过运行以下命令来执行此操作: sudo pacman -Rcs virtualbox-host-modules

然后,重新安装该包: sudo pacman -Syu virtualbox-host-modules

做了一个sudo modprobe -a vboxsf确认这对我有用。

相关内容