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

jml*_*jml 10 debootstrap chroot

我想创建最新 LTS 的虚拟实例,以便我可以以更接近我们的生产环境的方式测试我正在编写的软件。

似乎有很多很多不同的方法可以做到这一点:将 debootstrap 与 schroot 一起使用;将 debootstrap 与 dchroot 一起使用;使用 mk-sbuild... 而像https://wiki.ubuntu.com/DebootstrapChroot这样的页面有多个选项,现在肯定已经被小 shell 脚本取代了。

我该怎么做?

aqu*_*erd 3

该软件包pbuilder正是您所需要的。它将允许您构建 chroot 环境、构建并安装您的软件包。甚至pbuilder-cross存在多种。它是一组命令行工具,因此不需要虚拟机点击。经过陡峭但短暂的学习曲线后,您可能可以自动构建不同的架构和发行版修订。


wal*_*tor 0

在我的命令行上,我输入man -k virtual,然后发现vmbuilder(dpkg -S vmbuilder显示它在python-vm-builder包中。man vmbuilder说:

NAME  
       vmbuilder - builds virtual machines from the command line  

SYNOPSIS  
       vmbuilder <hypervisor> <distro> [OPTIONS]...  

       <hypervisor>  Hypervisor image format. Valid options: xen kvm vmw6 vmserver  

       <distro>      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.  
Run Code Online (Sandbox Code Playgroud)

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