问题
我尝试安装的所有软件包都无法安装,因为“insserv”和 virtualbox 存在问题。这可能是因为 VirtualBox,但我不知道是哪个部分导致了错误。我想知道是哪个部分(或者如果我错了,是 Ubuntu 中的哪个部分)导致了问题以及如何修复它。
信息
我不知道硬件信息是否重要,但可能重要。
软件+操作系统
我在 Ubuntu Xenial (16.04 LTS) 上安装了 VirtualBox 5.1 和扩展包。如果有必要的话,我安装了带 Guest Additions 的 Win XP Pro、FreeDOS 和 Puppy Linux (Racy),全部都在 中~/VirtualBox VMs/
。
如果这也很重要的话,通过上述 VBox 设置,我尝试获取 Fedora、Debian、OpenBSD、openSUSE、Kali 和 Linux Mint 的虚拟机。(可能还有更多,但我不记得了)
之前我安装了 VBox 4.3,但为了 5.1 而卸载了它。更早之前,我使用的是 Ubuntu Trusty (14.04.4 LTS) 和 VBox 4.3。两者都只有 Win XP Pro,没有客户添加程序。
硬件
Dell Precision M6300(是的,我已经老了),配有 NVIDIA G84GLM(Quadro FX 1600M)显卡、Broadcom BCM4312 802.11b/g LP-PHY(无线 1395 WLAN 迷你卡)以及一个未知的显卡,带有“适用于 Intel CPU 的处理器微码固件”驱动程序。
最新遭遇
尝试安装 BleachBit 时出现错误(大约 10 分钟前):
installArchives() failed: Selecting previously unselected package menu.
(Reading database ...
(Reading database ... 5%%
(Reading database ... 10%%
(Reading database ... 15%%
(Reading database ... 20%%
(Reading database ... 25%%
(Reading database ... 30%%
(Reading database ... 35%%
(Reading database ... 40%%
(Reading database ... 45%%
(Reading database ... 50%%
(Reading database ... 55%%
(Reading database ... 60%%
(Reading database ... 65%%
(Reading database ... 70%%
(Reading database ... 75%%
(Reading database ... 80%%
(Reading database ... 85%%
(Reading database ... 90%%
(Reading database ... 95%%
(Reading database ... 100%%
(Reading database ... 224061 files and directories currently installed.)
Preparing to unpack .../menu_2.1.47ubuntu1_i386.deb ...
Unpacking menu (2.1.47ubuntu1) ...
Selecting previously unselected package bleachbit.
Preparing to unpack .../bleachbit_1.10-1_all.deb ...
Unpacking bleachbit (1.10-1) ...
Selecting previously unselected package python-notify.
Preparing to unpack .../python-notify_0.1.1-4_i386.deb ...
Unpacking python-notify (0.1.1-4) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for install-info (6.1.0.dfsg.1-5) ...
Processing triggers for doc-base (0.10.7) ...
Processing 1 added doc-base file...
Processing triggers for gnome-menus (3.13.3-6ubuntu3) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160415-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Setting up virtualbox (5.0.18-dfsg-2build1) ...
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-qt:
virtualbox-qt depends on virtualbox (= 5.0.18-dfsg-2build1); 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
No apport report written because the error message indicates its a followup error from a previous failure.
Setting up menu (2.1.47ubuntu1) ...
Setting up python-notify (0.1.1-4) ...
Processing triggers for menu (2.1.47ubuntu1) ...
Setting up bleachbit (1.10-1) ...
Errors were encountered while processing:
virtualbox
virtualbox-qt
Setting up virtualbox (5.0.18-dfsg-2build1) ...
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-qt:
virtualbox-qt depends on virtualbox (= 5.0.18-dfsg-2build1); 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
对于我没有从软件中心或安装 DVD(我仅用它来获取 Broadcom 驱动程序)获得的所有东西,这个问题一直存在。
/etc/init.d/vboxdrv
脚本
以下是开头附近的摘录:
# Provides: vboxdrv
# Required-Start: $syslog
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: VirtualBox Linux kernel module
#### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH
DEVICE=/dev/vboxdrv
LOG="/var/log/vbox-install.log"
VERSION=4.3.38
MODPROBE=/sbin/modprobe
答案1
日志显示此处BleachBit安装成功:
Setting up bleachbit (1.10-1) ...
Dpkg 试图告诉您 virtualbox 软件包已安装,但未完全完成配置阶段。可能是 /var/lib/dpkg/info 中 virtualbox 的 postinst 脚本。主要故障如下:
insserv: script virtualbox: service vboxdrv already provided!
因此,该脚本尝试通过查看 /etc/init.d 脚本来注册 vboxdrv 以在启动时启动。我猜升级过程中出了点问题,遗留了一些文件。
您可以查看类似这样的资源https://wiki.debian.org/LSBInitScripts/DependencyBasedBoot并尝试进一步调试。我敢打赌 /etc/init.d 中有多个脚本包含“Provides: vboxdrv”标头。您可以在 /etc/init.d 中 grep 并找出哪一个是旧的。
您也可以尝试清除 virtualbox 包并重新安装它。