Remove older VirtualBox versions before installing VirtualBox-5.0 !
Uninstall VirtualBox -> sudo apt-get purge "^virtualbox-.*"
Carefully check what will be removed (before you confirm it).
Update the software repositories -> sudo apt-get update
Clean up -> sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get clean
Download and register the ORACLE public key ->
wget -q -O - https://www.virtualbox.org/download/oracle_vbox.asc | sudo apt-key add -
Add the VirtualBox repo to the software sources ->
echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list.d/oracle-vbox.list
Now update the software repositories again -> sudo apt-get update
Install VirtualBox -> sudo apt-get install dkms virtualbox-5.0
Note for other users who use a newer Ubuntu edition than 15.04 :
As of Ubuntu 16.04 the ORACLE public key to download has changed.
oracle_vbox.asc
has to be replaced with oracle_vbox_2016.asc
Best Answer
Your problem : Virtual Box keeps its folder and settings in your home folder. Delete everything inside the folder.
Uninstall VirtualBox first.
Run these commands to delete all virtual machines and settings and Virtual Hard Drives:
If you want to install it again. Run this command:
Additionally, check:
Kill any "ghost" processes you may think are relevant.