6

Python has a wonderful tool called a virtual environment, which lets you effectively hermetically seal various python libraries (which may conflict with each other!) from each other. Is there an equivalent tool for the whole of Ubuntu? Or, rather, for things I make?

For instance, I have a repo that requires a modified version of OpenCV 3.0. However, I'd like to make another version of OpenCV, version 3.1.0, with CUDA support, for an entirely different repo that I'm working on in parallel, as well as obtain the bugfixes in OpenCV 3.1.0. I'm not skilled enough to port the changes from the modified OpenCV 3.0 to OpenCV 3.1.0...is there a way to install both without them fighting? Perhaps with the Ubuntu equivalent of a virtual env?

eriophora
  • 161

1 Answers1

5

I would suggest you to use vagrant. Using vagrant you can easily create/destroy/re-create development and testing environments.

You use with docker,lxd,virtualbox as providers to build,test packages without making any change in your host system. It is very helpful to create identical development environments.

Vagrant provides functionality to take/restore snapshots of your virtual environment. Using docker as vagrant provisioner, you can build/test your virtual environment in no time. For example you need to test some new package, you just need to build docker image once with preinstalled libraries. Vagrant will provision docker image and test/run your built package. This way it saves lots of time to build virtual environment. You can use same image multiple times.

To install Vagrant, Download latest vagrant linux zip file,unzip it and copy vagrant binary to /usr/bin.

unzip vagrant*_linux_amd64.zip
sudo cp vagrant /usr/bin/ 

or You can install vagrant via apt.

sudo apt install vagrant

Verify vaagrant installation.

vagrant --version
KK Patel
  • 19,753