Ubuntu – Can’t uninstall Oracle VirtualBox 6.1

uninstallvirtualboxvirtualization

I'm using Ubuntu 20.04 and it's my main OS (No other OS installed except for Ubuntu)

When I try to uninstall Oracle VirtualBox 6.1 it says that there are VMs running even though there aren't (I checked all the processes running at the time)

I screenshotted this after trying to uninstall VirtualBox 6.1 and it keeps happening with every command that tries to remove it:

Running VMs found

I already tried running these commands:

sudo apt-get purge virtualbox-6.1:amd64

sudo apt-get --reinstall install  virtualbox

sudo apt-get remove virtualbox-6.1

And as you can see from the commands listed I even tried reinstalling it

And even in the Ubuntu Software app it says that there are no packages to remove

Unable to remove "Oracle VM VirtualBox": no packages to remove

Best Answer

I had essentially the same issue. By doing the following, I was able to resolve it:

sudo mkdir /usr/lib/virtualbox
sudo touch /usr/lib/virtualbox/postinst-common.sh
sudo touch /usr/lib/virtualbox/prerm-common.sh
sudo chmod +x /usr/lib/virtualbox/postinst-common.sh
sudo chmod +x /usr/lib/virtualbox/prerm-common.sh

Then I was able to install an upgraded Virtualbox.

Related Question