autopkgtest-build-lxc(1)
π autopkgtest-build-lxc π
okay so bestie, welcome to the autopkgtest-build-lxc page from the General Commands Manual β yes it's a real manpage, and yes we're gonna make it cute. it's a little script that builds or refreshes your autopkgtest LXC container for autopkgtest-virt-lxc. let's get into it π
β¨ NAME β¨
autopkgtest-build-lxc β Create or update autopkgtest container for autopkgtest-virt-lxc
πΈ SYNOPSIS πΈ
autopkgtest-build-lxc [--arch=architecture] [--keyring=path]
[--script=path] distribution release
and the deprecated form, which still exists but like... don't:
autopkgtest-build-lxc [options] distribution release architecture
[script]
π¦ DESCRIPTION π¦
so autopkgtest-build-lxc creates or updates an LXC container called autopkgtest-release, and that container is the one that's suitable for autopkgtest's LXC runner autopkgtest-virt-lxc(1). it's giving match made in heaven fr fr.
what it actually does under the hood? it calls lxc-create with the distribution template (which rn can be debian or ubuntu, that's the whole list bestie) plus -rrelease, so it builds a debootstrap-like container. then it enables deb-src apt sources, and runs apt-get update. slay. β¨
now β if the container already exists, it updates it as unintrusively as possible. how? first it creates a brand new temporary container autopkgtest-release.new, and then it rsyncs its root file system back to the existing autopkgtest-release. cute right?
β οΈ okay important warning moment: this could cause some side-effects and breakage if you have running containers with ephemeral overlays (i. e. using the --ephemeral option), but it does work in general. so like, be aware. π
also, this update process does not interfere at all if you use autopkgtest-virt-lxc with cloning. no drama, no tears. π«Ά
and one more thing β you need to call this as root</>, unless you set up LXC to allow per-user containers. but lowkey? user containers will not work with many or even most autopkgtests. so. yeah. π
π OPTIONS π
--arch=ARCHβ Specify a dpkg architecture name. By default, the native architecture is used.
the third positional parameter is a deprecated way to specify this. (we don't stan the positional route anymore, use the flag bestie.)
--keyring=KEYRINGβ Specify the path to a keyring used to verify the apt repository. By default, the choice of keyring will be left todebootstrap. This option is mainly useful for use with a Debian derivative in conjunction with theMIRRORenvironment variable. π--script=SCRIPTβ Specify the path to a script to be executed inside the container to customize the container. The script must be a POSIX shell script, and should not depend on bash-specific features.
the fourth positional parameter is a deprecated way to specify this. (again β deprecated. periodt.)
π ENVIRONMENT π
If the $AUTOPKGTEST_KEEP_APT_SOURCES environment variable is set to a non-empty value, autopkgtest-build-lxc will keep whatever /etc/apt/sources.list was created by lxc-create. keeping it, not touching it, we respect the original. β
Otherwise, if the $AUTOPKGTEST_APT_SOURCES_FILE environment variable is set to a non-empty value, for example AUTOPKGTEST_APT_SOURCES_FILE=/home/me/mydistro/sources.list, then autopkgtest-build-lxc will read that file (on the host system) and use it to populate /etc/apt/sources.list in the container; or if the $AUTOPKGTEST_APT_SOURCES environment variable is set to a non-empty value, for example AUTOPKGTEST_APT_SOURCES=$(cat /home/me/mydistro/sources.list), autopkgtest-build-lxc will write it directly into /etc/apt/sources.list in the container.
When $AUTOPKGTEST_APT_SOURCES_FILE or $AUTOPKGTEST_APT_SOURCES contain sources in the deb822 format, then sources are written to /etc/apt/sources.list.d/<distro>.sources in the virtual container, rather than /etc/apt/sources.list. (yes the <distro> is a placeholder bestie, don't type it literally π)
You can specify an apt proxy to use in the container in the $AUTOPKGTEST_APT_PROXY environment variable. If you have an apt proxy configured on the host, the container will automatically use this, otherwise there is no default. In case you want to prevent your local proxy to be picked up you can specify UNCONFIGURED as the value for $AUTOPKGTEST_APT_PROXY. iconic little escape hatch tbh.
π EXAMPLES π
# autopkgtest-build-lxc debian sid
$ sudo autopkgtest-build-lxc ubuntu trusty i386
look at that. two whole examples. we ate. π
π₯ SEE ALSO π₯
autopkgtest-virt-lxc(1), autopkgtest(1), lxc-create(1), /usr/share/doc/autopkgtest/.
π AUTHORS AND COPYRIGHT π
autopkgtest-build-lxc was written by Martin Pitt <martin.pitt@ubuntu.com> β ty king π«Ά
This manpage is part of autopkgtest, a tool for testing Debian binary packages. autopkgtest is Copyright (C) 2006-2014 Canonical Ltd and others.
See /usr/share/doc/autopkgtest/CREDITS for the list of contributors and full copying conditions.
and that's the whole page bestie π this was the Linux Programmer's Manual version, dated 2014, and yeah the page itself is autopkgtest-build-lxc(1). now go build that container, you've got this. no cap. β¨ππ¦
π¦ where this page comes from
- debian trixie: autopkgtest 5.49 Β· GPL-2.0-or-later
- ubuntu jammy: autopkgtest 5.47~22.04.1 Β· GPL-2.0-or-later
- ubuntu noble: autopkgtest 5.55~24.04.1 Β· GPL-2.0-or-later
- ubuntu questing: autopkgtest 5.49
- ubuntu resolute: autopkgtest 5.55 Β· GPL-2.0-or-later
- ubuntu stonking: autopkgtest 6.0 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms