To BPLis
Maybe this wont solve your problem as threads have been merged, but what you posted solved my problem.
I solved it by not doing
dpkg --purge virtualbox (as what was the package that came with stretch)
but by what you suggested here.
apt-get remove virtualbox* --purge
The only reason why I think this happened was that maybe there are different virtualbox packages coexisting
dpkg --purge virtualbox did nothing to resolve my problem and it failed again after installation although it uninstalled a lot of things, which was what put me off track I guess.
apt-get remove virtualbox* --purge has a wildcard so it must have removed something that is virtualboxXYZ, which is what dpkg --purge virtualbox could not remove.
Whatever the reason it solved it thanks.
Here is the procedure in case someone has my particular problem:
apt-get remove virtualbox* --purge
and NOT apt-get remove virtualbox
as is proposed all around the web.
Then reinstall from site as was instructed Linux Downloads
https://www.virtualbox.org/wiki/Linux_Downloads
I use Debian Stretch, so I installed the debian virtualbox with Gdebi.
It suddenly worked. Virtualbox package names must have changed.
BP LIS wrote:I mentioned earlier that I uninstalled and reinstalled VB, but to no avail. Now I read in an Ubuntu form that there is an additional command to uninstall everything, even configuration files:
To uninstall and remove all packages, run sudo apt-get remove virtualbox* --purge
Would that help?