---
name: "mk-sbuild"
section: "1"
platform: "linux"
package: "ubuntu-dev-tools"
version: "0.206"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mk-sbuild"
---

# mk-sbuild(1)

creates chroots via schroot and sbuild

## NAME

mk-sbuild - creates chroots via schroot and sbuild

## SYNOPSIS

**mk-sbuild** \[*options*...\] \<*release*\>

## DESCRIPTION

**mk-sbuild** creates chroots via schroot and sbuild.

## OPTIONS

Listed below are the command line options for mk-sbuild:

- **--arch=*ARCH***

  What architecture to select (defaults to the native architecture).

- **--target=ARCH**

  Set up the chroot as a cross-building environment targeting the specified architecture.

- **--name=*NAME***

  Base name for the schroot (arch is appended).

- **--personality=*PERSONALITY***

  What personality to use (defaults to match **--arch**).

- **--debug**

  Turn on script debugging.

- **--skip-updates**

  Do not include the **-updates** pocket in the installed **sources.list**.

- **--skip-proposed**

  Do not include the **-proposed** pocket in the installed **sources.list**.

- **--source-template=*FILE***

  Use *FILE* as the **sources.list** template (defaults to *$HOME***/.mk-sbuild.sources**).

- **--debootstrap-mirror=*URL***

  Use *URL* as the debootstrap source (defaults to **http://ports.ubuntu.com** where appropriate, official Ubuntu repositories for the supported architectures).

- **--debootstrap-include=*alpha,beta***

  Pass along a comma separated list of packages to debootstrap's **--include** argument. See **debootstrap** (8) for more details.

- **--debootstrap-exclude=*alpha,beta***

  Pass along a comma separated list of packages to debootstrap's **--exclude** argument. **WARNING:** be careful using this option as you can end up excluding essential package. See **debootstrap** (8) for more details.

- **--debootstrap-keyring=*keyring***

  Pass along the path to a gpg keyring file to debootsrap's **--keyring** argument. See **debootstrap** (8) for more details.

- **--debootstrap-no-check-gpg**

  Disable checking gpg signatures of downloaded Release files by using debootstrap's **--no-check-gpg** option. See **debootstrap** (8) for more details.

- **--debootstrap-proxy=*PROXY***

  Use *PROXY* as apt proxy.

- **--eatmydata**

  Install and use eatmydata (default)

- **--skip-eatmydata**

  Don't install and use eatmydata

- **--distro=*DISTRO***

  Enable distro-specific logic. When not provided, the distribution is determined from *release*. Currently known distros: "**debian**" and "**ubuntu**".

- **--vg=*VOLUME\_GROUP***

  Specify a volume group, and subsequently use a default **SCHROOT\_TYPE** of "**lvm-snapshot**" rather than "**directory**" (via overlayfs or aufs) mounts.

- **--zfs-dataset=*DATASET***

  Specify a zfs dataset, and subsequently use a default **SCHROOT\_TYPE** of "**zfs-snapshot**" rather than "**directory**" (via overlayfs or aufs) mounts.

- **--type=*SHROOT\_TYPE***

  Specify a **SCHROOT\_TYPE**.  Supported values are "**directory**" (default if **--vg** not specified), "**lvm-snapshot**" (default if **--vg** specified), "**btrfs-snapshot**", "**zfs-snapshot**" and "**file**".

- **--ccache**

  Enable usage of **ccache** by default. See **ccache** (1) for more details.

- **--ccache-dir=*PATH***

  Use **PATH** as schroot ccache directory. This directory can be safely shared by multiple schroots, but they will all use the same **CCACHE\_MAXSIZE**. Defaults to /var/cache/ccache-sbuild. See **ccache** (1) for more details.

- **--ccache-size=*SIZE***

  Sets **SIZE** as the schroot **CCACHE\_DIR** max-size used by ccache. See **ccache** (1) for more details.

## ENVIRONMENT VARIABLES

- **LV\_SIZE**

  Size of source LVs (defaults to 5G).

- **SNAPSHOT\_SIZE**

  Size of snapshot LVs (defaults to 4G).

- **SCHROOT\_CONF\_SUFFIX**

  Lines to append to schroot entries.

- **SCHROOT\_PROFILE**

  Profile to use with schroot. (defaults to sbuild)

- **SKIP\_UPDATES**

  Do not include the **-updates** pocket (same as **--skip-updates**)

- **SKIP\_PROPOSED**

  Do not include the **-proposed** pocket (same as **--skip-proposed**)

- **DEBOOTSTRAP\_MIRROR**

  Mirror location (same as **--debootstrap-mirror**)

- **DEBOOTSTRAP\_INCLUDE**

  Comma separated list of packages to include when bootstrapping (same as **--debootstrap-include**)

- **DEBOOTSTRAP\_EXCLUDE**

  Comma separated list of packages to exclude when bootstrapping (same as **--debootstrap-exclude**; see warning above)

- **DEBOOTSTRAP\_KEYRING**

  Keyring file to use for checking gpg signatures of retrieved release files (same as **--debootstrap-keyring**)

- **DEBOOTSTRAP\_NO\_CHECK\_GPG**

  Disable gpg verification of retrieved release files (same as **--debootstrap-no-check-gpg**)

- **DEBOOTSTRAP\_PROXY**

  Proxy to use for apt. (same as **--debootstrap-proxy**)

- **EATMYDATA**

  Enable or disable eatmydata usage, see **--eatmydata** and **--skip-eatmydata**

- **SOURCE\_CHROOTS\_DIR**

  Use **SOURCE\_CHROOTS\_DIR** as home of schroot source directories. (default **/var/lib/schroot/chroots**)

- **SOURCE\_CHROOTS\_TGZ**

  Use **SOURCE\_CHROOTS\_TGZ** as home of schroot source tarballs. (default **/var/lib/schroot/tarballs**)

- **CHROOT\_SNAPSHOT\_DIR**

  Use **CHROOT\_SNAPSHOT\_DIR** as home of mounted btrfs snapshots. (default **/var/lib/schroot/snapshots**)

- **CCACHE**

  Enable **ccache** (1) by default. (defaults to **0**)

- **CCACHE\_DIR**

  Use **CCACHE\_DIR** as the **ccache** (1) directory. (default **/var/cache/ccache-sbuild**)

- **CCACHE\_SIZE**

  Use **CCACHE\_SIZE** as the **ccache** (1) max-size. (defaults to **4G**)

## FILES

- *$HOME***/.mk-sbuild.rc**

  Sourced for environment variables (defined above).

- *$HOME***/.mk-sbuild.sources\[.***$DISTRO\]*

  Can contain a customized **sources.list**. It will be read when creating the schroot. If a file with "**.ubuntu**" or "**.debian**" is found (as appropriate) it will use used instead. See **sources.list** (5) for more details on the format.

- *$HOME***/.mk-sbuild.schroot.conf\[.***$SCHROOT\_TYPE\]*

  Can contain a customized configuration section to be inserted into **/etc/schroot/schroot.conf**. If a file with "**.lvm-snapshot**", "**.directory**", "**.file**", or "**btrfs-snapshot**" is found (as appropriate) that file will use used instead. See **schroot.conf** (5) for more details on the format.

## USING THE CHROOTS

- To CHANGE the golden image: **sudo schroot -c** *${SCHROOT\_NAME}***-source -u root**

  - To ENTER an image snapshot: **schroot -c** *$SCHROOT\_NAME*

  - To BUILD within a snapshot: **sbuild -A -d** *$SCHROOT\_NAME $PACKAGE***\*.dsc**

  - for example, to update the packages in a **sid-amd64** golden image:

  **schroot -c sid-amd64-source -u root -- sh -c "apt-get -qq update && apt-get -qy upgrade && apt-get clean" \</dev/null**

## SEE ALSO

[**sbuild-setup**(7)](/sbuild-setup/7.md), [**sources.list**(5)](/sources.list/5.md), [**schroot.conf**(5)](/schroot.conf/5.md), **https://help.ubuntu.com/community/SbuildLVMHowto**

## AUTHOR

**mk-sbuild** was written by Kees Cook \<kees@ubuntu.com\>. This man page was written by Ryan Kavanagh \<ryanakca@kubuntu.org\>. Both are released under the GNU General Public License, version 3 or later.
