I'm using Linux Mint 17 and I have to uninstall virtualbox-4.3 from the system, but it's giving me the following error.

$ 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:

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:


E: Sub-process /usr/bin/dpkg returned an error code (1)

Please help, i will be thankful to you.

  • Try creating the missing file: sudo touch /etc/init.d/functions – Jason Hobbs Nov 30 '14 at 1:58

The upstream VirtualBox packages contain an init script that tries to detect your distribution. It isn't doing a good job on your system: it's looking for /etc/init.d/functions, which should be a Red Hat thing, on a Debian-based system.

Since you're purging the package, rather than try to fix the script, it's simpler to work around it. Add the following lines at the top of the file /etc/init.d/vboxdrv:

rmmod vboxpci vboxnetadp vboxnetflt vboxdrv
rm /dev/vboxdrv
exit 0

and run

apt-get remove --purge virtualbox-4.3
  • Sorry for late reply, i tried it, thanks it worked..so happy..thanks a ton :) – Aman Tandon Dec 8 '14 at 16:15

First run:

sudo yum list installed | grep virtualbox

This will show something like:

VirtualBox-5.0.x86_64        5.0.10_104061_el7-1      @virtualbox

Then to remove, just run:

  • seems you forgot to add last line – Jakuje Jan 4 '16 at 22:22
  • Not to mention that the question is for Mint, which isn't RedHat-based and doesn't have or use yum, and apt-get had in fact identified the correct package, that wasn't the problem, which was correctly solved over a year ago. – dave_thompson_085 Jan 4 '16 at 23:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.