http://tecadmin.net/install-oracle-virtualbox-on-ubuntu/
Step 1: Setup Apt Repository
Firstly edit /etc/apt/sources.list file and add one of following line according to your distribution to your system. You can find your system distribution codename using “lsb_release -c” command from terminal.
For Ubuntu 16.04 ("Xenial")
deb http://download.virtualbox.org/virtualbox/debian xenial contrib
For Ubuntu 15.10 ("Wily")
deb http://download.virtualbox.org/virtualbox/debian wily contrib
For Ubuntu 14.04 ("Trusty")
deb http://download.virtualbox.org/virtualbox/debian trusty contrib
For Ubuntu 12.04 LTS ("Precise Pangolin")
deb http://download.virtualbox.org/virtualbox/debian precise contrib
For Debian 8 ("Jessie")
deb http://download.virtualbox.org/virtualbox/debian jessie contrib
For Debian 7 ("Wheezy")
deb http://download.virtualbox.org/virtualbox/debian wheezy contrib
Step 2: Setup Oracle public key
After adding required apt repository in your system, download and import the Oracle public key for apt-secure using following commands.
$ 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 -
Step 3: Install Oracle VirtualBox
After completing above steps, lets install VirtualBox using following commands. If you have already installed any older version of VirtualBox, Below command will update it automatically.
$ sudo apt-get update
$ sudo apt-get install virtualbox-5.1
Step 4: Start VirtualBox
We can use dashboard shortcuts to start VirtualBox or simply run following command from terminal.
$ virtualbox
Step 1: Setup Apt Repository
Firstly edit /etc/apt/sources.list file and add one of following line according to your distribution to your system. You can find your system distribution codename using “lsb_release -c” command from terminal.
For Ubuntu 16.04 ("Xenial")
deb http://download.virtualbox.org/virtualbox/debian xenial contrib
For Ubuntu 15.10 ("Wily")
deb http://download.virtualbox.org/virtualbox/debian wily contrib
For Ubuntu 14.04 ("Trusty")
deb http://download.virtualbox.org/virtualbox/debian trusty contrib
For Ubuntu 12.04 LTS ("Precise Pangolin")
deb http://download.virtualbox.org/virtualbox/debian precise contrib
For Debian 8 ("Jessie")
deb http://download.virtualbox.org/virtualbox/debian jessie contrib
For Debian 7 ("Wheezy")
deb http://download.virtualbox.org/virtualbox/debian wheezy contrib
Step 2: Setup Oracle public key
After adding required apt repository in your system, download and import the Oracle public key for apt-secure using following commands.
$ 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 -
Step 3: Install Oracle VirtualBox
After completing above steps, lets install VirtualBox using following commands. If you have already installed any older version of VirtualBox, Below command will update it automatically.
$ sudo apt-get update
$ sudo apt-get install virtualbox-5.1
Step 4: Start VirtualBox
We can use dashboard shortcuts to start VirtualBox or simply run following command from terminal.
$ virtualbox