How to install Virtualbox on Ubuntu 12.04 LTS Precise Pangolin

1. Download and install Oracle’s public key.

[email protected]:~$ wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

2. Create a repo file for Virtualbox

[email protected]:~$ sudo -s  echo "deb http://download.virtualbox.org/virtualbox/debian precise contrib" >> ~/virtualbox.list

[email protected]:~$ sudo mv ~/virtualbox.list /etc/apt/sources.list.d/

3. Install Virtualbox

[email protected]:~$ sudo apt-get update

[email protected]:~$ sudo apt-get install dkms

[email protected]:~$ sudo apt-get install virtualbox-4.1

Enjoy.