How to install Vagrant on Ubuntu 22.04 | FOSS Linux

6.5K

Vagrant is an open source software used to manage and generate different virtual environments using virtualization technologies such as VirtualBox, VMware and more. Simplifies the management of virtual machine configurations to increase productivity with the help of provisioners. Provisioners primarily allows customization of virtual machine configuration.

Vagrant offers many development environments to DevOps, allowing developers to work across multiple operating systems. An interesting feature of Vagrant is that you can install this tool on almost all Linux distributions. It is essential to know that Vagrant is a command-line generated tool.

Also, you

need to make sure you have a virtualization engine like Hyper-V, VirtualBox, or Docker configuration on your system, as you can’t run Vagrant tools without virtualization software. The Vagrant plugin system is also compatible with KVM and VMware.

Installing Vagrant on Ubuntu 22.04

With that covered, let’s launch the article to find out how we can configure Vagrant on our Ubuntu 22.04 system using VirtualBox as a virtualization hypervisor.

Prerequisites

The virtual machine is required to install

Vagrant

. In this case,

you can choose any virtual machine, from Hyper-V, Docker, VirtualBox to VMware, but in our case, we will use VirtualBox in this tutorial. Alternatively, if you are a VMware fan and need guidance on installing VMware on Ubuntu, you can visit our other published article.

VirtualBox

VirtualBox

is a cloud computing virtualization technology software that allows multiple applications and operating system workloads to run on one server, enabling better resource management by creating a virtual machine that behaves precisely like a real computer. If you haven’t set up VirtualBox on your Ubuntu system, here is a detailed post on how to do it.

This article will focus on three methods of installing Vagrant on Ubuntu 22.04: Using apt Using

  • apt-get Using aptitude

Let’s get the article up and running

. Method 1: How to Set Up Vagrant on Ubuntu

22.04 Using apt

You can quickly achieve

Vagrant installation on

Ubuntu

in a fairly simple way by following the given steps

:

Step 1: Update Ubuntu Packages

First things first, update the system repository to the latest versions. To do this, open your terminal by pressing the shortcut keys “CTRL + ALT + T” together and issue the following

update command: sudo apt update

Step 2: Update

Ubuntu Packages Once you run the update command

, you will be alerted to the number of packages that require an update at the end of the update command. This tells you that the mentioned number of packages has released newer versions. To update them, run the following command and remember that you can skip this step once you find that all your packages are up to date

: sudo apt upgrade Step 3: Install

VirtualBox Next, we will install VirtualBox on our system using the following command

: sudo apt install

virtualbox Step 4: Install Vagrant

Once you have finished installing VirtualBox, It’s time to download the Vagrant

deb package by running the following command in your terminal: wget https://releases.hashicorp.com/vagrant/2.2.19/vagrant_2.2.19_x86_64.deb

Then use the following command to install the deb package from the apt installer

: sudo apt install ./vagrant_2.2.19_x86_64.deb vagrant -version Package: vagrant Architecture: all Version: 2.2.19+dfsg-1ubuntu1 Priority: Optional section: universe/admin Source: Ubuntu Maintainer: Ubuntu Developers Original Maintainer: Debian Ruby Team Errors: https://bugs.launchpad.net/ubuntu/+filebug Installed size: 3476 Depends: libarchive-tools, curl, openssh-client, rsync, ruby, ruby-bcrypt-pbkdf, ruby-childprocess, ruby-ed25519, ruby-erubi, ruby-i18n, ruby-listen, ruby-log4r, ruby-mime-types, ruby-net-ssh, ruby-net-sftp, ruby-net-scp, ruby-rexml, ruby-zip, ruby-vagrant-cloud Recommends: vagrant-libvirt Suggests: virtualbox (>= 4.0) Breaks: virtualbox ( >= 6.2) File name: pool/universe/v/vagrant/vagrant_2…2.19+dfsg-1ubuntu1_all.deb Size: 473364 MD5sum: 8299 5ce230e36e17a3a60f655 a514e717c SHA1: 92a370b18cff0be7ff54be9ef1be69a7f84b0331 SHA256: 4ef003a92282a98d01e12f6f368413ee4f08b995af457d64bfc375ba9fc9d71f SHA512: b487fabc8f7fe3bba6de5b7a12cb7a6af54a5e75a8017990e7aa7a7b8dba9b4eeba1e0880fcfa5f914777e06c56f8d159ed174cba1c3d827814856b71d2ca79c Home page: https://www.vagrantup.com Description: Tool for creating and distributing virtualized development environments Description-md5: aeaa276f3844f8ad6c87b93eb0f56ea5 Ruby-Versions: all Method 2: How to install Vagrant on Ubuntu using apt-get sudo apt-get update sudo apt-get upgrade sudo apt-get -y install vagrant

Method 3:

How to install Vagrant using aptitude sudo apt install aptitude sudo aptitude update sudo aptitude -y install vagrant

How to Use Vagrant on Ubuntu 22.04

mkdir ~/project_name mkdir ~/fosslinux_project cd ~/fosslinux_project vagrant init debian/jessie64 vagrant up How to uninstall Vagrant on Ubuntu. How to uninstall Vagrant and its dependencies. How to uninstall settings and tramp data

  • .
  • How to uninstall

  • vagabond
  • settings, data and all their dependencies. How to Uninstall Vagrant in Ubuntu

  • 22.04

sudo apt-get remove vagrant How to uninstall Vagrant and its dependencies sudo apt-get -y autoremove vagrant How to uninstall vagrant settings and data sudo apt-get -and purge vagrant

How to uninstall vagrant settings, data, and all its dependencies

sudo apt-get –

and

autoremove -purge

vagrant

Final Thoughts