安装VirtualBox时出错


13

我正在运行debian 7并尝试使用以下命令安装virtualbox:

sudo apt-get install virtualbox

并获得以下输出:

Selecting previously unselected package virtualbox.
Unpacking virtualbox (from .../virtualbox_4.1.18-dfsg-2+deb7u1_amd64.deb) ...
Selecting previously unselected package virtualbox-dkms.
Unpacking virtualbox-dkms (from .../virtualbox-dkms_4.1.18-dfsg-2+deb7u1_all.deb) ...
Selecting previously unselected package virtualbox-qt.
Unpacking virtualbox-qt (from .../virtualbox-qt_4.1.18-dfsg-2+deb7u1_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for menu ...
Processing triggers for hicolor-icon-theme ...
Processing triggers for shared-mime-info ...
Processing triggers for desktop-file-utils ...
Setting up libvncserver0:amd64 (0.9.9+dfsg-1) ...
Setting up virtualbox (4.1.18-dfsg-2+deb7u1) ...
insserv: script virtualbox: service vboxdrv already provided!
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
dpkg: error processing 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 (>= 4.1.18-dfsg-2+deb7u1); however:
  Package virtualbox is not configured yet.

dpkg: error processing virtualbox-dkms (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of virtualbox-qt:
 virtualbox-qt depends on virtualbox (= 4.1.18-dfsg-2+deb7u1); however:
  Package virtualbox is not configured yet.

dpkg: error processing virtualbox-qt (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 virtualbox
 virtualbox-dkms
 virtualbox-qt
E: Sub-process /usr/bin/dpkg returned an error code (1)

有人可以帮忙吗?


我会尝试以下命令(以该顺序,当然还有sudodpkg -P virtualbox virtualbox-dkms virtualbox-qt:(删除包,包括配置),apt-get clean(清理缓存),apt-get update(获取包信息)apt-get install virtualbox-dkmsapt-get install virtualbox..
mpy

Answers:


28

本文(法语)描述了Debian上的相同错误:Virtualbox&vboxdrv
解决方法是删除两个文件,然后按如下所示重新安装Virtualbox

rm -r /etc/init.d/vboxdrv
rm -r /var/lib/update-rc.d/vboxdrv 
apt-get install virtualbox virtualbox-dkms virtualbox-guest-utils virtualbox-guest-additions virtualbox-qt

本文还列出了适用于Fedora的解决方案:

/etc/init.d/vboxdrv setup

稍后在注释中使用本apt-get purge virtualbox应代替的注释,该注释apt-get remove也将删除init脚本,因此这可能是问题的真正原因,只需执行即可解决purge


这实际上对我有用。非常少
mawburn

在尝试了几乎所有其他方法之后,我发现了这一点,并且奏效了。非常感谢你!
Sgoettschkes 2014年

-1

收到该错误后,请尝试apt-get -f install强制安装由于该错误而未加载的文件。然后再次尝试apt-get升级,来回安装apt-get -f,直到只剩下有错误的软件包。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.