---
name: "autopkgtest-build-incus"
section: "1"
platform: "linux"
package: "autopkgtest"
version: "5.49"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/autopkgtest-build-lxd"
---

# autopkgtest-build-incus(1)

Create or update autopkgtest container for autopkgtest-virt-lxd or autopkgtest-virt-incus

Part of [autopkgtest-build-lxd(1)](/autopkgtest-build-lxd/1.md).

## NAME

autopkgtest-build-lxd, autopkgtest-build-incus - Create or update autopkgtest container for autopkgtest-virt-lxd or autopkgtest-virt-incus

## SYNOPSIS

**autopkgtest-build-lxd** *image*

**autopkgtest-build-incus** *image*

## DESCRIPTION

**autopkgtest-build-lxd** creates or updates a LXD or Incus image which is optimized for autopkgtest's LXD/Incus runner [**autopkgtest-virt-lxd**(1)](/autopkgtest-virt-lxd/1.md) or [**autopkgtest-virt-incus**(1)](/autopkgtest-virt-incus/1.md).

When run as **autopkgtest-build-lxd** or with the **--lxd** option, LXD is used. When run as **autopkgtest-build-incus** or with the **--incus** option, Incus is used.

The images produced by this tool are intended to be suitable for use with either LXD or Incus.

It builds a temporary container from an existing given image, runs autopkgtest's standard **setup-commands/setup-testbed** script, and publishes it as a new image with the alias **autopkgtest/***distro*/*release*/*architecture*.

## OPTIONS

- **-h \| --help**

  Display help message and exit.

- **--vm**

  Prepare a VM image instead of a container image, to be used with **autopkgtest-virt-lxd --vm** or **autopkgtest-virt-incus --vm**.

- **--lxd**

  Use LXD. This is the default when invoked as **autopkgtest-build-lxd**.

- **--incus**

  Use Incus. This is the default when invoked as **autopkgtest-build-incus**.

- **-r REMOTE \| --remote REMOTE**

  Run container or VM on given remote host instead of locally; see **lxc remote list** or **incus remote list**.

## ENVIRONMENT

If the **$AUTOPKGTEST\_KEEP\_APT\_SOURCES** environment variable is set to a non-empty value, **autopkgtest-build-lxd** will keep whatever **/etc/apt/sources.list** was present in the existing image.

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-lxd** 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-lxd** 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 container, rather than **/etc/apt/sources.list.**

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.

For dist-upgrading *image* to a newer release you can specify the destination release in the **$RELEASE** environment variable. This is useful when a new distribution series has just been opened and there are no standard images for that available yet.

## EXAMPLE

Build a local autopkgtest container image for Debian sid i386, based on the stock Debian image from the public **images.linuxcontainers.org** remote:

$ autopkgtest-build-lxd images:debian/sid/i386

or:

$ autopkgtest-build-incus images:debian/sid/i386

## SEE ALSO

[**autopkgtest-virt-lxd**(1)](/autopkgtest-virt-lxd/1.md), [**autopkgtest**(1)](/autopkgtest/1.md), [**lxc**(1)](/lxc/1.md), **/usr/share/doc/autopkgtest/**.

## AUTHORS AND COPYRIGHT

**autopkgtest-build-lxd** was written by Martin Pitt \<martin.pitt@ubuntu.com\>

This manpage is part of autopkgtest, a tool for testing Debian binary packages.  autopkgtest is Copyright (C) 2006-2015 Canonical Ltd and others.

See **/usr/share/doc/autopkgtest/CREDITS** for the list of contributors and full copying conditions.
