To remove virtualbox, run:
sudo apt autoremove --purge virtualbox*
Now make sure there is no other version installed on your system by:
dpkg -l virtualbox* | grep ^i
You shouldn't get any output.
Then remove all related PPAs from your sources.list
and sources.list.d
directory. ex:
mkdir ~/apt-tmp
sudo mv /etc/apt/sources.list.d/* ~/apt-tmp
Make sure there is nothing except official repositories sources in
/etc/sources.list.
And update your sources:
sudo apt update
Now we can search to see which versions are available to install:
apt-cache madison virtualbox | grep -iv sources
Which produces an output like this:
virtualbox | 5.1.38-dfsg-0ubuntu1.16.04.1 | http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages
virtualbox | 5.0.18-dfsg-2build1 | http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages
Then install the lastest version mentioned above:
sudo apt install virtualbox=5.1.38-dfsg-0ubuntu1.16.04.1
Also sudo apt install virtualbox
, would be fine, but I would go with the former command to make sure my desired version is going to be installed.
And after all, check that the correct version is installed.
From command line:
dpkg -l virtualbox* | grep ^i
which will output:
ii virtualbox 5.1.38-dfsg-0ubuntu1.16.04.1 amd64 x86
virtualization solution - base binaries
ii virtualbox-dkms 5.1.38-dfsg-0ubuntu1.16.04.1 all x86
virtualization solution - kernel module sources for dkms
ii virtualbox-qt 5.1.38-dfsg-0ubuntu1.16.04.1 amd64 x86
virtualization solution - Qt based user interface
Then also you can run:
sudo apt upgrade
Just in case.
I have the same problem after upgrading from 5.0.0 to 5.0.8 on Windos 10. – Ben Collins – 2015-11-06T15:49:44.750
FYI, I had this error on Fedora 23. I had both i686 and x86_64 installed. I had to uninstall the i686 version which I had manually installed from a downloaded RPM. – HeatfanJohn – 2016-02-22T23:38:29.287
Hit this with 5.0.16, a re-install fixed it – KCD – 2016-03-10T02:25:58.273