在最新的 Ubuntu 更新之后,我无法打开 virtualbox,启动时它出现错误,提示内核驱动程序未加载或未正确设置,我应该重新安装 virtualbox-dkms 包。
删除 virtualbox 并尝试重新安装后,出现以下错误:
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash'
Error! Bad return status for module build on kernel: 5.8.0-34-generic (x86_64)
Consult /var/lib/dkms/virtualbox/6.1.10/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
dpkg: dependency problems prevent configuration of virtualbox:
virtualbox depends on virtualbox-dkms (>= 6.1.10-dfsg-1~ubuntu1.20.04.1) | virtualbox-source (>= 6.1.10-dfsg-1~ubuntu1.20.04.1) | virtualbox-modules; however:
Package virtualbox-dkms is not configured yet.
Package virtualbox-source is not installed.
Package virtualbox-modules is not installed.
Package virtualbox-dkms which provides virtualbox-modules is not configured yet.
dpkg: error processing package virtualbox (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of virtualbox-qt:
virtualbox-qt depends on virtualbox (= 6.1.10-dfsg-1~ubuntu1.20.04.1); however:
Package virtualbox is not configured yet.
dpkg: error processing package virtualbox-qt (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates it's a follow-up error from a previous failure.
No apport report written because the error message indicates it's a follow-up error from a previous failure.
Processing triggers for menu (2.1.47ubuntu4) ...
Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu2) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for systemd (245.4-4ubuntu3.3) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for shared-mime-info (1.15-1) ...
Errors were encountered while processing:
virtualbox-dkms
virtualbox
virtualbox-qt
E: Sub-process /usr/bin/dpkg returned an error code (1)
即使我使用 grub 菜单从前一个内核启动时也会发生这种情况,如能提供任何帮助我将非常感激。
我也尝试过使用 aptitude 从其他存储库中删除任何冲突的 virtualbox 版本,但问题仍然存在。
答案1
发生这种情况的原因是 Ubuntu 20.04 将内核升级到 5.8,但您从 Ubuntu 存储库安装的 6.1.10 版本的 VirtualBox 不支持此内核。
您有两个选择:
删除现有的 VirtualBox 使用
apt remove virtualbox
并安装 VirtualBox 6.1.16https://virtualbox.org。删除 5.8 内核并坚持使用 5.4.0-xx 内核。
我认为第一个选项更简单且更可取。
答案2
Ubuntu 20.04 存储库已更新 vbox 6.1.16。我在 1 月 25 日注意到了这一点,但不知道它们是什么时候更新的。Vbox 现在可以正确构建和打开。
答案3
第三个解决方案对我有用:下载并安装 VirtualBox 版本所有发行版。 (看VirtualBox 下载页面)。
- 下载最新版本(当前为 6.1.16)全部分布从VirtualBox 下载页面。
wget -O ~/Downloads/virtualbox.run https://download.virtualbox.org/virtualbox/6.1.16/VirtualBox-6.1.16-140961-Linux_amd64.run
- 安装 VirtualBox
cd Downloads # enter Downloads
chmod +x virtualbox.run # set execution permission
./virtualbox.run # run the installer
注意:在重新安装 VirtualBox 之前,我已删除了之前的安装apt purge
。