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!

Frequently Asked Questions

How to install VirtualBox 4.2 in Ubuntu 12.04 via repository?

To install VirtualBox 4.2 in Ubuntu 12.04 via its repository, you can add the repository's key, add the repository itself, and then update your system and install VirtualBox using specific commands as outlined in the tutorial.

What are the benefits of installing software through repositories in Ubuntu?

Installing software through repositories in Ubuntu allows for automatic updates and security patches, ensuring that your software stays up to date and secure without manual intervention.

What key command is used to add VirtualBox repository's key in Ubuntu?

The key command used to add the VirtualBox repository's key in Ubuntu is 'wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -'.

How can I add VirtualBox repository to my Ubuntu system?

You can add the VirtualBox repository to your Ubuntu system by running the command 'sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian precise contrib" >> /etc/apt/sources.list''.

What commands are used to update the system and install VirtualBox in Ubuntu?

To update the system and install VirtualBox in Ubuntu, you need to run the commands 'sudo apt-get update && sudo apt-get install virtualbox-4.2' in the terminal.

Why should I consider installing VirtualBox via its repository in Ubuntu 12.04?

Installing VirtualBox via its repository in Ubuntu 12.04 allows for easier management, automatic updates, and seamless integration with the Ubuntu package management system.

Can I install VirtualBox 4.2 in Ubuntu without using the Software Center?

Yes, you can install VirtualBox 4.2 in Ubuntu without using the Software Center by adding its repository and following the commands provided in the tutorial.

What is the shortcut to open the terminal in Ubuntu for installing VirtualBox 4.2?

To open the terminal in Ubuntu for installing VirtualBox 4.2, press Ctrl + Alt + T on your keyboard to launch the terminal window.