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.


  • 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 -O- | sudo apt-key add -




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

sudo sh -c 'echo "deb precise contrib" >> /etc/apt/sources.list'




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