VirtualBox is a powerful x86 virtualization product for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL).
VirtualBox 3.0.6 released on Sep. 9,2009,which improves stability and performance.
To update to the latest version,first make a backup for your current VMs(File->Export Appliance…),although the fresh installation won’t hurt current VMs setups.


Remove the old version with this command:

sudo apt-get remove --purge virtualbox

This won’t delete your VMs which lie in your home directory. And now download the latest version from VirtualBox home page ,double click to install it.
Also,you can install it by adding source in source.list:

sudo gedit /etc/apt/sources.list

add this line to the file,save and close it.
For ubuntu 9.04:

deb jaunty non-free

For ubuntu 8.10:

deb intrepid non-free

For ubuntu 8.04:

deb hardy non-free

Then,add the GPG key:

wget -q -O- | sudo apt-key add -

Update and install:

sudo apt-get update
apt-get install virtualbox-3.0

Replace virtualbox-3.0

  by virtualbox to install VirtualBox 1.6.6
   by virtualbox-2.0 to install VirtualBox 2.0.10
   by virtualbox-2.1 to install VirtualBox 2.1.4
   by virtualbox-2.2 to install VirtualBox 2.2.4