Seeing that there was a new VirtualBox release, I tried to install it on Kubuntu 15.04...

However, now all of my VBox 4.3 packages in the ubuntu repositories are broken (Virtualbox is provided by Virtualbox-5.0 which is not installed), and VirtualBox 5.0 won't work as it says DKMS is broken:

Uninstalling old VirtualBox DKMS kernel modules/etc/init.d/vboxdrv: 302: /etc/init.d/vboxdrv: /usr/share/virtualbox/src/vboxhost/do_dkms: not found
 ...done.
Trying to register the VirtualBox kernel modules using DKMS/etc/init.d/vboxdrv: 327: /etc/init.d/vboxdrv: /usr/share/virtualbox/src/vboxhost/do_dkms: not found
 ...failed!
  (Failed, trying without DKMS)

Reinstalling virtualbox-dkms:

dpkg: error processing package virtualbox-dkms (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of virtualbox-qt:
 virtualbox-qt depends on virtualbox (= 4.3.26-dfsg-2ubuntu2); however:
  Package virtualbox is not configured yet.
  Package virtualbox-5.0 which provides virtualbox is not installed.

dpkg: error processing package virtualbox-qt (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates it's a follow-up error from a previous failure.

Even though VirtualBox 5.0 was installed via deb package from the Oracle website.

What can I do to either completely remove 5.0 and install VirtualBox 4.3, or correctly install virtualbox 5.0?

I've already tried uninstalling VirtualBox 5.0 (via apt-get purge), then installing 4.3, but get the error relating to VirtualBox being provided by the package virtualbox-5.0.

share|improve this question
up vote 24 down vote accepted

You have to completely remove older VirtualBox versions before installing VirtualBox-5.0 !

Uninstall VirtualBox -> sudo apt-get purge "^virtualbox-.*"

Check carefully what will be removed before you confirm.

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 repository to the sources ->

echo "deb http://download.virtualbox.org/virtualbox/debian vivid contrib" | sudo tee /etc/apt/sources.list.d/oracle-vbox.list  

Update software repositories again -> sudo apt-get update

Install VirtualBox -> sudo apt-get install dkms virtualbox-5.0

Note for other users reading this answer, in case they use another Ubuntu edition as 15.04 :

You have to replace vivid with the Ubuntu edition you are using when adding the repository !

As of Ubuntu 16.04 the ORACLE public key to download and register has changed :

oracle_vbox.asc has to be replaced with oracle_vbox_2016.asc !

share|improve this answer
3  
Be careful with the * and apt-get: this command accepts a regular expression, not a glob-pattern!. Your command should be apt-get purge "^virtualbox-.*". In this case is probably the same, but it will bite you... see askubuntu.com/questions/210976/… – Rmano Aug 26 '15 at 14:14
    
@Rmano - thanks for your comment. I checked the sudo apt-get purge virtualbox-* command. Result was virtualbox only and suggestion to autoremove libsdl-ttf afterwards, which was installed as a dependency together with virtualbox. Main reason to take this specific command was to be sure that nothing of the former virtualbox installation would remain. Anyway I take your warning seriously, so I added "Check carefully what will be removed before you confirm" to my answer. – cl-netbox Aug 26 '15 at 15:16
    
@Rmano was correct... Using a regex worked for me where * did not, it initially said it couldn't find the virtualbox-5.0.2... package. – BnMcG Aug 26 '15 at 16:56
    
@BnMcG --- that was probably because you issued the command from the directory where you had the virtualbox-5.0.2... .deb package. Without the quotes, shell expansion took precedence, and the * was substituted before apt-get had a chance to see it. – Rmano Aug 26 '15 at 17:24
    
Here is the link to the official manual describing proposed approach for all debian-based distributions: virtualbox.org/wiki/… – Alex Paliarush Nov 14 '15 at 22:42

My Virtualbox does not work. It starts but could not execute any of the machines. The solution I found was:

sudo apt-get install virtualbox-dkms

and then:

sudo modprobe vboxdrv
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.