How To Install virtualbox on Ubuntu 18.04

In this tutorial we learn how to install virtualbox on Ubuntu 18.04. virtualbox is x86 virtualization solution - base binaries

Introduction

In this tutorial we learn how to install virtualbox on Ubuntu 18.04.

What is virtualbox

virtualbox is:

VirtualBox is a free x86 virtualization solution allowing a wide range of x86 operating systems such as Windows, DOS, BSD or Linux to run on a Linux system.

This package provides the binaries for VirtualBox. Either the virtualbox-dkms or the virtualbox-source package is also required in order to compile the kernel modules needed for virtualbox. A graphical user interface for VirtualBox is provided by the package virtualbox-qt.

There are three methods to install virtualbox on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install virtualbox Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install virtualbox using apt-get by running the following command:

sudo apt-get -y install virtualbox

Install virtualbox Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install virtualbox using apt by running the following command:

sudo apt -y install virtualbox

Install virtualbox Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install virtualbox using aptitude by running the following command:

sudo aptitude -y install virtualbox

How To Uninstall virtualbox on Ubuntu 18.04

To uninstall only the virtualbox package we can use the following command:

sudo apt-get remove virtualbox

Uninstall virtualbox And Its Dependencies

To uninstall virtualbox and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove virtualbox

Remove virtualbox Configurations and Data

To remove virtualbox configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge virtualbox

Remove virtualbox configuration, data, and all of its dependencies

We can use the following command to remove virtualbox configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge virtualbox

References

Summary

In this tutorial we learn how to install virtualbox package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.