samip@samip510:~$ sudo apt-get install virtualbox
[sudo] password for samip:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libgsoap7 libvncserver1 virtualbox-dkms virtualbox-qt
Suggested packages:
vde2 virtualbox-guest-additions-iso
The following NEW packages will be installed:
libgsoap7 libvncserver1 virtualbox virtualbox-dkms virtualbox-qt
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,970 kB/21.7 MB of archives.
After this operation, 92.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://np.archive.ubuntu.com/ubuntu/ wily/multiverse virtualbox-qt amd64 5.0.4-dfsg-2 [6,970 kB]
Fetched 2,245 kB in 4min 1s (9,282 B/s)
Selecting previously unselected package libgsoap7:amd64.
dpkg: warning: files list file for package 'unity-scope-virtualbox' missing; assuming package has no files currently installed
(Reading database ... 205331 files and directories currently installed.)
Preparing to unpack .../libgsoap7_2.8.22-1_amd64.deb ...
Unpacking libgsoap7:amd64 (2.8.22-1) ...
Selecting previously unselected package libvncserver1:amd64.
Preparing to unpack .../libvncserver1_0.9.10+dfsg-3_amd64.deb ...
Unpacking libvncserver1:amd64 (0.9.10+dfsg-3) ...
Selecting previously unselected package virtualbox.
Preparing to unpack .../virtualbox_5.0.4-dfsg-2_amd64.deb ...
Unpacking virtualbox (5.0.4-dfsg-2) ...
Selecting previously unselected package virtualbox-dkms.
Preparing to unpack .../virtualbox-dkms_5.0.4-dfsg-2_all.deb ...
Unpacking virtualbox-dkms (5.0.4-dfsg-2) ...
Selecting previously unselected package virtualbox-qt.
Preparing to unpack .../virtualbox-qt_5.0.4-dfsg-2_amd64.deb ...
Unpacking virtualbox-qt (5.0.4-dfsg-2) ...
Processing triggers for man-db (2.7.4-1) ...
Processing triggers for systemd (225-1ubuntu9) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Processing triggers for shared-mime-info (1.3-1) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu1) ...
Processing triggers for bamfdaemon (0.5.2~bzr0+15.10.20150627.1-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils (0.22-1ubuntu3) ...
Processing triggers for mime-support (3.58ubuntu1) ...
Setting up libgsoap7:amd64 (2.8.22-1) ...
Setting up libvncserver1:amd64 (0.9.10+dfsg-3) ...
Setting up virtualbox (5.0.4-dfsg-2) ...
insserv: script virtualbox: service vboxdrv already provided!
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package virtualbox (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of virtualbox-dkms:
virtualbox-dkms depends on virtualbox (>= 5.0.4-dfsg-2); however:
Package virtualbox is not configured yet.
Package virtualbox-4.3 which provides virtualbox is not installed.
dpkg: error processing package virtualbox-dkms (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of virtualbox-qt:
virtualbox-qt depends on virtualbox (= 5.0.4-dfsg-2); however:
Package virtualbox is not configured yet.
Package virtualbox-4.3 which provides virtualbox is not installed.
dpkg: error processing package virtualbox-qt (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.21-0ubuntu4) ...
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for systemd (225-1ubuntu9) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
virtualbox
virtualbox-dkms
virtualbox-qt
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
每当我们在旧版本(例如 4.3.x)上安装较新的 Virtual Box 主要版本(例如 5.0.x)时,我们必须先删除旧版本(包括其内核模块),然后才能继续。
由于某种原因,这并没有发生在您仍然加载了 4.3 内核模块的系统上。
要删除以前的 VirtualBox 安装,我们可以执行:
sudo apt-get purge virtualbox*
我们可能需要重新启动才能卸载旧的内核模块。之后,我们应该能够从存储库重新安装较新的版本:
sudo apt-get update
sudo apt-get install virtualbox
也可以通过以下方式安装修复了错误的最新版本添加官方 Oracle 存储库向我们的消息来源。我建议这样做。
答案2
我遇到了这个问题并尝试了所有的解决方案,但都没有用!
但是我看到了这个解决方案,它竟然有效!显然问题出在我的内核版本上,当你更新内核时,dkms 模块可以在安装 virtualbox 期间正确安装。
因此,您要做的就是删除所有 virtualbox 包:
sudo apt-get remove virtualbox virtualbox-4.* virtualbox-5.0
然后更新内核:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install linux-generic
然后重新启动系统:
然后安装virtualbox:
从 virtualbox.org 网站获取安装 deb 文件并安装
我希望它也适合你。
答案3
找到了这个错误的完美解决方案
cd /var/lib/dpkg/info/
sudo rm virtualbox*
sudo apt-get update
sudo apt-get autoremove
应该可以解决。我在 ubuntu 15.10 64 位中完成了此操作。
问候,
哈希姆·内维斯
答案4
我遇到过类似的问题。我尝试在 Ubuntu 14.04 64 位系统中安装 i386(32 位)版本的 Virtual Box。然后我下载了 AMD64(64 位)版本,它运行良好。因此请确保您使用的是适当版本的虚拟盒。