3

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

3
  • 1
    What exactly is the error message you receive ?
    – Liso
    May 11, 2020 at 4:31
  • Install on which OS? Please advise the distribution and the release number of the host OS.
    – K7AAY
    May 11, 2020 at 4:50
  • I'm using Ubuntu 20.04. I'm not really sure what you mean with host OS, but Ubuntu is my main OS. The error message that I receive is that I have running VMs (as the picture that I posted shows) and because of that I can't reinstall it or remove it from my system.
    – Azgalor
    May 11, 2020 at 22:22

5 Answers 5

3

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.

1

From your commands, I am assuming you are using any of Debian based distro

Uninstall the VirtualBox (6.1) and delete all of the virtual machines & it's settings

sudo apt-get remove --purge virtualbox-6.1 

sudo rm ~/"VirtualBox VMs" -Rf

sudo rm ~/.config/VirtualBox/ -Rf

If you have a plan to install VirtualBox in the later time, don't delete the virtual hard drives

In that case, use these commands

sudo apt-get remove --purge virtualbox-6.1

sudo rm ~/.config/VirtualBox/ -Rf
1
  • Thanks for the answer, but for whatever reason it keeps telling me that there are VMs running (There are not, I already checked the running processes)
    – Azgalor
    May 11, 2020 at 22:18
1

I fixed it. Virtualbox was actually running in the background, but it wasn't showing in the system monitor and that's why I wasn't able to see it.

I found the process with the command sudo ps -a which outputted this:

   PID TTY          TIME CMD
123500 tty2     00:00:19 Xorg
123531 tty2     00:00:00 gnome-session-b
124722 pts/1    00:00:01 frontend
124731 pts/1    00:00:00 virtualbox-6.1.
125166 pts/2    00:00:00 sudo
125167 pts/2    00:00:00 ps

Then I just did sudo killall virtualbox-6.1. and it let me remove it.

0

sudo dpkg -P virtualbox-6.1

This removed VirtualBox on Ubuntu 20.04

0

In my case I had VirtualBox auto-start with Startup Applications Preferences which blocked the update. Once I disabled the auto-start and did a reboot your update command worked

   sudo apt-get --reinstall install virtualbox

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .