Last week we showed you how to install VirtualBox 4.2 in Ubuntu by downloading and install it from Software Center. To read that post, click here.

Well, that method too, works. But if you prefer to install it via its repository, it’s now possible to do just that, and this brief tutorial is going to show you how to accomplish it. Installing software in Ubuntu through its repositories allows for automatic updates and security patches.

Objectives:

  • Install VirtualBox via its repository
  • Enjoy!

To get started, press Ctrl – Alt – T on your keyboard to open the terminal. When it opens, run the commands below to add its repository’s key.

wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

 

virtualbox_4.2

 

Next, copy and paste the commands below to add its repository.

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian precise contrib" >> /etc/apt/sources.list'

 

virtualbox_4.2_1

 

Finally, run the commands below to update your system and install VirtualBox 4.2

sudo apt-get update && sudo apt-get install virtualbox-4.2

 

virtualbox_4.2_2

 

Enjoy!