How To Install python3-vagrant on Debian 11

In this tutorial we learn how to install python3-vagrant on Debian 11. python3-vagrant is Python 3 bindings for interacting with Vagrant virtual machines

Introduction

In this tutorial we learn how to install python3-vagrant on Debian 11.

What is python3-vagrant

python3-vagrant is:

python-vagrant is a Python module that provides a thin wrapper around the vagrant command line executable, allowing programmatic control of Vagrant virtual machines (boxes). This project began to create Python bindings for Vagrant to programmatically access vagrant boxes using Fabric. This module is useful for:

  • Starting a Vagrant virtual machine (VM) (up)
  • Terminating a Vagrant VM (destroy)
  • Halting a Vagrant VM without destroying it (halt)
  • Querying the status of a VM or VMs (status)
  • Getting ssh configuration information useful for SSHing into the VM (host, port, …)
  • Running vagrant commands in a multi-VM environment (http://vagrantup.com/v1/docs/multivm.html) by using vm_name parameter
  • Initializing the VM based on a named base box, using init().
  • Adding, Removing, and Listing boxes (box add, box remove, box list)
  • Provisioning VMs - up() accepts options like no_provision, provision, and provision_with, and there is a provision() method
  • Using sandbox mode from the Sahara gem: https://github.com/jedi4ever/sahara

This package is beta and its API is not guaranteed to be stable. The API attempts to be congruent with the vagrant API terminology, to facilitate knowledge transfer for users already familiar with Vagrant. Over time, the python-vagrant API has changed to better match the underling vagrant CLI and to evolve with the changes in that CLI.

The package version numbering is in the form 0.X.Y. The initial 0 reflects the beta nature of this project. The number X is incremented when backwards-incompatible changes occur. The number Y is incremented when backwards-compatible features or bug fixes are added.

This package provides the Python 3.x module.

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

Install python3-vagrant Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install python3-vagrant

Install python3-vagrant Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python3-vagrant

Install python3-vagrant 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 Debian. Update apt database with aptitude using the following command.

sudo aptitude update

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

sudo aptitude -y install python3-vagrant

How To Uninstall python3-vagrant on Debian 11

To uninstall only the python3-vagrant package we can use the following command:

sudo apt-get remove python3-vagrant

Uninstall python3-vagrant And Its Dependencies

To uninstall python3-vagrant and its dependencies that are no longer needed by Debian 11, we can use the command below:

sudo apt-get -y autoremove python3-vagrant

Remove python3-vagrant Configurations and Data

To remove python3-vagrant configuration and data from Debian 11 we can use the following command:

sudo apt-get -y purge python3-vagrant

Remove python3-vagrant configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge python3-vagrant

Dependencies

python3-vagrant have the following dependencies:

References

Summary

In this tutorial we learn how to install python3-vagrant package on Debian 11 using different package management tools: apt, apt-get and aptitude.