#!/bin/bash
dist=$(lsb_release -c | awk '{ print $2 }')
echo "deb http://download.virtualbox.org/virtualbox/debian $dist non-free" > virtualbox.list
sudo mv virtualbox.list /etc/apt/sources.list.d/
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
sudo apt-get update
new_package=`apt-cache search virtualbox | grep Oracle | tail -n 1 | awk '{ print $1 }'`
echo $new_package
sudo apt-get install $new_package
