Ubuntu: How to completely remove virtualbox [duplicate]


This question already has an answer here:

I had installed VirtualBox but it started giving me problems. So I uninstalled it using:-

sudo apt-get remove virtualbox-\*  sudo apt-get purge virtualbox-\*  

But when I reinstalled VirtualBox it again resumed to previous settings and started giving same problems. How can i completely remove VirtualBox from my laptop and then reinstall it such that it wont give same problem again?


Your problem : Virtual Box keeps its folder and settings in your home folder. Delete everything inside the folder.

Uninstall VirtualBox first.

sudo apt-get remove --purge virtualbox   

Run these commands to delete all virtual machines and settings and Virtual Hard Drives:

sudo rm ~/"VirtualBox VMs" -Rf  sudo rm ~/.config/VirtualBox/ -Rf  

If you want to install it again. Run this command:

sudo apt-get install virtualbox  


First find installed package using below command :

sudo dpkg -l | grep virtualbox   

Then copy packages and remove using dpkg or apt-get as below :

sudo dpkg --purge <Packages>  

--force-all optional

And also manually remove folder on home directory (~/"VirtualBox VMs").


sudo apt remove virtualbox virtualbox-5.0 virtualbox-4.*  

After that, you maybe get some instruction which will already give there you just need to type on the command line. Then again run same above command.


sudo apt-get remove virtualbox* --purge  

Just try one command for remove all VM.


For me nothing helped but this

$ sudo /opt/VirtualBox/uninstall.sh  $ sudo rm -rf /opt/VirtualBox/  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »