如何创建早期版本的Ubuntu的chroot?

我想创建一个最新LTS的虚拟实例,这样我就可以测试我正在编写的软件,使其与我们的生产环境更加匹配。

似乎有很多种不同的方法:使用debootstrap和schroot; 使用debootstrap与dchroot; 使用mk-sbuild …像https://wiki.ubuntu.com/DebootstrapChroot这样的页面有多个选项,现在肯定已被小shell脚本替换。

我该怎么做?

pbuilder正是你需要的。 它将允许您构建chroot环境,构建和安装包。 甚至存在pbuilder-cross变种。 它是一组命令行工具,因此不需要虚拟机点和点击。 经过一段陡峭但很短的学习曲线,您可以自动构建不同的体系结构和分发修订版。

在我的命令行中,我键入man -k virtual ,并找到了vmbuilderdpkg -S vmbuilderpython-vm-builder包中显示它man vmbuilder说:

 NAME vmbuilder - builds virtual machines from the command line SYNOPSIS vmbuilder   [OPTIONS]...  Hypervisor image format. Valid options: xen kvm vmw6 vmserver  Distribution. Valid options: ubuntu DESCRIPTION This manual page documents the vmbuilder command. vmbuilder is a program that builds virtual machines from the command line, but can have other interfaces implemented through its plugin mechanism. You can pass command line options to add extra packages, remove packages, choose which version of Ubuntu, which mirror etc. On recent hardware with plenty of RAM, tmpdir in /dev/shm or using a tmpfs, and a local mirror (see apt-proxy or apt-mirror), you can bootstrap a vm in less than a minute. 

注意:我不使用这个包,所以YMMV