I have installed virtualbox from Software Center, then tried to install extension pack but then realized the package was for the new version 5.1 instead of the old one on Software Center. So I removed the old version, but encountered an error saying extension pack folder was not empty, so I removed the whole folder where extension pack was stored. Now if I try to install/update/remove virtuabox I get this error:
The following packages will be REMOVED: virtualbox-5.1* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 158 MB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 273859 files and directories currently installed.) Removing virtualbox-5.1 (5.1.8-111374~Ubuntu~xenial) ... dpkg: error processing package virtualbox-5.1 (--purge): subprocess installed pre-removal script returned error exit status 1 /var/lib/dpkg/info/virtualbox-5.1.postinst: 95: /var/lib/dpkg/info/virtualbox-5.1.postinst: /usr/lib/virtualbox/prerm-common.sh: not found /var/lib/dpkg/info/virtualbox-5.1.postinst: 96: /var/lib/dpkg/info/virtualbox-5.1.postinst: /usr/lib/virtualbox/postinst-common.sh: not found Errors were encountered while processing: virtualbox-5.1 E: Sub-process /usr/bin/dpkg returned an error code (1)
Also, when I run
sudo apt-get purge virtualbox-\*
A terminal pops up saying "Running VMs found" while as far as I can see there are none. Any help will be appreciated as I am quite new to Ubuntu.