Installing VirtualBox on Ubuntu 18.04

Installing VirtualBox on Ubuntu 18.04

VirtualBox used to be installed easily using apt, but this recently changed. Here is a method proven to work:

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bionic contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
sudo apt-get update
sudo apt-get -y install virtualbox-6.0