1. Remove the old version of virtual box. (Note the * is required, because it will remove all the virtualbox related packages)
sudo apt purge virtualbox*
2. Execute the following commands to install.
sudo apt update sudo apt upgrade wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian bionic contrib" sudo apt update