I'd like to create a virtual instance of the latest LTS so I can test the software I'm writing in a way that more closely matches our production environment.
There seem to be many, many different ways of doing this: use debootstrap with schroot; use debootstrap with dchroot; use mk-sbuild... And pages like https://wiki.ubuntu.com/DebootstrapChroot have multiple options, and must surely have been replaced by small shell scripts by now.
How should I do this?
The package
pbuilder
is exactly what you need. It will allow you to construct a chroot environment, build and install your package. Even apbuilder-cross
variety exists. It is a set of command line tools, so no virtual machine point and click required. After a steep but short learning curve, you can probably automate building different architectures and distribution revisions.On my command line, I typed
man -k virtual
, and foundvmbuilder
(dpkg -S vmbuilder
shows it's in thepython-vm-builder
package.man vmbuilder
says:Note: I don't use this package, so YMMV.