add key

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -

add sources

sudo sh -c 'echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list.d/virtualbox.list'

update

apt update

install

apt install virtualbox-5.2

add extension pack

  download

wget -O ~/Downloads/Oracle_VM_VirtualBox_Extension_Pack-5.2.4-119785.vbox-extpack http://download.virtualbox.org/virtualbox/5.2.4/Oracle_VM_VirtualBox_Extension_Pack-5.2.4-119785.vbox-extpack

  
在下载下来的文件上单击鼠标右键,用virtualbox打开即可启动扩展包的安装程序。