How do I create a chroot of an earlier version of Ubuntu?

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 a pbuilder-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.