我正在使用 Linux Mint 17,我必须从系统中卸载 virtualbox-4.3,但它给了我以下错误。
$ sudo apt-get remove --purge virtualbox-4.3
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
virtualbox-4.3*
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 155 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 194033 files and directories currently installed.)
Removing virtualbox-4.3 (4.3.12-93733~Ubuntu~raring) ...
/etc/init.d/vboxdrv: 85: .: Can't open /etc/init.d/functions
invoke-rc.d: initscript vboxdrv, action "stop" failed.
dpkg: error processing package virtualbox-4.3 (--purge):
subprocess installed pre-removal script returned error exit status 2
Errors were encountered while processing:
virtualbox-4.3
E: Sub-process /usr/bin/dpkg returned an error code (1)
请帮忙,我将非常感谢你。
答案1
上游 VirtualBox 软件包包含一个尝试检测您的发行版的初始化脚本。它在你的系统上表现不佳:它正在/etc/init.d/functions
基于 Debian 的系统上寻找 ,这应该是 Red Hat 的事情。
由于您要清除包,而不是尝试修复脚本,因此解决它更简单。在文件顶部添加以下行/etc/init.d/vboxdrv
:
#!/bin/sh
rmmod vboxpci vboxnetadp vboxnetflt vboxdrv
rm /dev/vboxdrv
exit 0
并运行
apt-get remove --purge virtualbox-4.3
答案2
第一次运行:
sudo yum list installed | grep virtualbox
这将显示类似以下内容:
VirtualBox-5.0.x86_64 5.0.10_104061_el7-1 @virtualbox
然后要删除,只需运行: