SBUILD-CREATECHROOT(8)
πΈ NAME πΈ
okay so this is sbuild-createchroot β the Debian sbuild manual, section 8, bestie β and the whole point is: create an sbuild chroot. Thatβs the vibe. π
β¨ SYNOPSIS β¨
Hereβs the summoning circle, character-for-character:
sbuild-createchroot [-h|--help | -V|--version] [--verbose] [--arch=arch]
[--chroot-prefix=prefix] [--chroot-suffix=suffix] [--chroot-
mode=schroot|sudo|unshare] [--foreign] [--resolve-deps | --no-resolve-
deps] [--merged-usr | --no-merged-usr | --auto-merged-usr] [--keep-
debootstrap-dir] [--debootstrap=debootstrap]
[--include=package1[,package2,[packagen]]]
[--exclude=package1[,package2,[packagen]]]
[--components=component1[,component2,[componentn]]] [--keyring=keyring-
file] [--setup-only] [--make-sbuild-tarball=file]
[--keep-sbuild-chroot-dir] [--no-deb-src] [--alias=alias]
[--extra-repository=spec] [--command-prefix=prefix] SUITE TARGET-
DIRECTORY [DEBIAN-MIRROR-URI [SCRIPT]]
buildd-create-chroot USER SUITE TARGET-DIRECTORY [DEBIAN-MIRROR-URI]
π DESCRIPTION π
β οΈ lowkey important: this tool is only useful for theschrootbackend. Debian buildds have switched to theunsharebackend in 2024. periodt.
<pink>sbuild-createchroot</pink> runs debootstrap(1) to create a chroot suitable for building packages with sbuild. Note that while debootstrap may be used directly, sbuild-createchroot performs additional setup tasks such as adding additional packages and configuring various files in the chroot. Invoking sbuild-createchroot is functionally equivalent to running debootstrap --variant=buildd --include=fakeroot,build-essential, then editing /etc/apt/sources.list and /etc/hosts by hand.
The newly-created chroot is set up to work with schroot(1) by creating a chroot definition file under /etc/schroot/chroot.d. This should be edited to finish the chroot configuration after sbuild-createchroot has completed.
buildd-create-chroot, like sbuild-createchroot, runs debootstrap(1) to create a chroot for package building. However, this creates a chroot specifically for buildd(1) with an additional mandatory option to specify a user who will be granted sudo access inside the chroot. This script mainly differs in its additional customisation of /etc/apt/sources.list to use incoming.debian.org and security-master.debian.org. It also removes some packages from the newly-created chroot. Unless you are setting up an official Debian build daemon, sbuild-createchroot should be used instead. The extra functionality will be merged into sbuild-createchroot in the future.
π OPTIONS π
π¬ Actions π¬
-h,--helpβ display this manual.-V,--versionβ print version information.
π General options π
-v,--verboseβ print all messages.
π§ Debootstrap options π§
vibe check: debootstrap(1) is the canonical reference for the meaning of the options; they are passed directly to debootstrap.
--arch=archβ set the target architecture. This may be used ifdpkgis not already installed. See also--foreign, below.--chroot-suffix=suffixβ add a custom suffix to the chroot name. Defaults to-sbuild.--chroot-prefix=prefixβ add a custom prefix to the chroot name. Defaults toSUITE. This is useful to create variants of a base suite likestretch-backportsto which the backports archive can be manually added after the base chroot was created usingsbuild-shell. This way, a normalstretchchroot and astretch-backportschroot can exist side-by-side. Besides this common use case, this functionality can also be used to create chroots with any other type of customization. It is a shortcut for creating a base chroot and then having to manually copy it and edit the configuration files.--chroot-mode=schroot|sudo|unshareβ the sbuild chroot backend to generate the chroot for. Theautopkgtestbackend is not supported by this method because of the diversity of container types it supports. To generate a chroot forschrootandsudo,sbuild-createchrootmust be executed with superuser privileges (for example by usingsudo). Because of backwards compatibility, choosingschrootimpliessudo(but not the other way round). Choosingunsharerequires the--make-sbuild-tarballoption. Creating a chroot for theunsharebackend can be done by a normal user (without sudo) but it requires Linux user namespaces to be enabled (viasysctl -w kernel.unprivileged_userns_clone=1). Chroot tarballs created for theunsharebackend are also compatible with theschrootbackend if a respective schroot config file is manually created by the user or by runningsbuild-createchrootwith the--setup-onlyoption. Defaults toschroot.--foreignβ only perform the initial unpack phase of bootstrapping. This is required if the target and host architectures do not match. Note thatdebootstraprequires running by hand to complete installation; run thedebootstrap /debootstrap/debootstrapinstalled inTARGET-DIRECTORYto complete the installation.--resolve-depsβ automatically resolve missing dependencies. This is the default.--no-resolve-depsβ do not automatically resolve missing dependencies.--keep-debootstrap-dirβ donβt delete the/debootstrapdirectory inTARGET-DIRECTORYafter completing the installation.--debootstrap=debootstrapβ define a custom debootstrap variant. Defaults todebootstrap.--include=package1[,package2,[packagen]]β comma separated list of packages which will be added to the list of packages to download and extract.--exclude=package1[,package2,[packagen]]β comma separated list of packages which will be removed from the list of packages to download and extract. Note that this can remove essential packages, so use with extreme care.--components=component1[,component2,[componentn]]β comma separated list of archive components to use (e.g.main,contrib,non-free). Defaults tomain.--keyring=keyring-fileβ download signatures for retrievedReleasefiles and check them against keyring-file. By default/etc/apt/trusted.gpgis used. Set to an empty string to disable signature checking.--merged-usrβ create a chroot in which/bin,/sbinand/lib*are symbolic links to their counterparts in/usr.--no-merged-usrβ create a chroot in which/bin,/sbinand/lib*are ordinary directories distinct from their counterparts in/usr.--auto-merged-usrβ do not specify whether/bin,/sbinand/lib*are symbolic links to their counterparts in/usr. In this casedebootstrapwill use its default behaviour (which is suite-specific). This is the default.SUITEβ the distribution to bootstrap (e.g.stretch[cq],buster,bullseye,sid). A complete list may be found in/usr/share/debootstrap/scripts.TARGET-DIRECTORYβ the directory to create the chroot in. The directory will be created if it does not already exist.DEBIAN-MIRROR-URIβ anhttp://,file:///, orssh:///URI pointing to a suitable archive mirror. Defaults tohttp://deb.debian.org/debian.SCRIPTβdebootstrapscript to run. Not typically required.
π sbuild-createchroot behaviour π
--setup-onlyβ donβt rundebootstrap. Only perform the setup tasks on an already existing chroot. This is useful for converting an existing chroot for use with sbuild which has already been created using a tool such asdebootstrap. Some configuration steps can only be carried out on a directory chroot and thus, this option is not useful with theunsharebackend.--make-sbuild-tarball=fileβ create a bootstrapped file type chroot ready for use with sbuild and save it as file. The compression format used for the tarball is dependent on the file extension used in file. See the TARBALL FILE section for more details.--keep-sbuild-chroot-dirβ donβt delete the directory used for creating a file type chroot. This option does nothing if not creating a file type chroot.--no-deb-srcβ donβt add adeb-srcline to the/etc/apt/sources.listfile in theTARGET-DIRECTORYafter thedebootstrapprocess. This is useful in situation when it is known that sbuild will never have to download the source package itself but is always given an already downloadeddsc. In that case, this option will help to save bandwidth and disk space because the source indices donβt have to be downloaded and later continually updated.--alias=aliasβ add an alternative name that the chroot will be known by. This option can be given multiple times to add more than one alias. Using an alias is useful for chroots of distributions that are known by more than one name. For example Debian unstable is also known assid. Additionally, sbuild chooses the distribution by the latest changelog entry which could listUNRELEASEDfor packages that the maintainer is currently working on. For Debian it thus makes sense to addUNRELEASEDas an alias for a Debian unstable chroot. This option is only allowed when choosing--chroot-mode=schroot. For similar functionality with--chroot-mode=unshareyou can work with symlinks. See the EXAMPLES section for how to use this option in practice.--extra-repository=specβ add a repository to the list of apt sources. The repository specification is a line suitable for an aptsources.list(5)file. For instance, you might use--extra-repository="deb http://deb.debian.org/debian experimental main"to allow packages in the experimental distribution to fulfill build-dependencies. Note that the build chroot must already trust the key of this repository. See the EXAMPLES section for how to combine this option with--chroot-prefixand--alias.--command-prefix=prefixβ set the chroot command-prefix option as specified. A common use-case is to specifyeatmydata, thereby preventing all commands executed in the chroot from syncing data to disk. This option is only allowed when choosing--chroot-mode=schroot. Seeschroot.conf(5)for more details.
π¦ TARBALL FILE π¦
ok so when you're making an sbuild tarball file, the compression format is literally decided by the extension you put on file. it's giving "your filename is the vibe check." here's the full rundown of which extensions get detected and what format the tarball comes out as:
*.tarβ makes an uncompressed tarball. no compression, just raw vibes.*.tar.gz|*.tgzβ makes a compressed tarball using gzip π*.tar.bz2|*.tbzβ makes a compressed tarball using bzip2*.tar.lz|*.tlzβ makes a compressed tarball using lzip*.tar.xz|*.txzβ makes a compressed tarball using xz β¨
and if you specify no extension at all, bestie, sbuild-createchroot will straight up rename file to file.tar.gz and generate file.tar.gz as a compressed tarball using gzip. like it just decides for you. main character energy tbqh.
π EXAMPLES π
ok these are the moment, fr fr. let's go.
1. to create a bootstrapped file type sid (unstable) chroot ready for use with sbuild and schroot (the default backend), saved in /srv/chroot/unstable-amd64.tar.gz, using the deb.debian.org Debian http mirror redirector service and using a temporary directory as the target:
% sudo sbuild-createchroot \
--make-sbuild-tarball=/srv/chroot/unstable-amd64.tar.gz \
unstable `mktemp -d` \
http://deb.debian.org/debianβ΅
2. to create a plain type sid (unstable) schroot chroot in /srv/chroot/unstable using the deb.debian.org Debian http mirror redirector service and with aliases for unstable and UNRELEASED:
% sudo sbuild-createchroot unstable /srv/chroot/unstable-amd64 \
--alias=sid --alias=UNRELEASED \
http://deb.debian.org/debianβ΅
3. to create a schroot chroot to build for stretch backports:
% sudo sbuild-createchroot \
--extra-repository="deb http://deb.debian.org/debian stretch-backports main" \
--chroot-prefix=stretch-backports \
stretch /srv/chroot/stretch-backports-amd64 \
http://deb.debian.org/debianβ΅
4. to create a schroot chroot to build for experimental using a custom chroot prefix:
% sudo sbuild-createchroot \
--extra-repository="deb http://deb.debian.org/debian experimental main" \
--chroot-prefix=experimental \
unstable /srv/chroot/unstable-experimental-amd64 \
http://deb.debian.org/debianβ΅
5. creating a chroot for the unshare backend does not require superuser privileges (no sudo, bestie, you're free π¦). the path for the tarball is the default path expected by sbuild for the unshare backend:
% sbuild-createchroot --chroot-mode=unshare \
--make-sbuild-tarball ~/.cache/sbuild/unstable-amd64.tar.gz \
unstable `mktemp -d` http://deb.debian.org/debianβ΅
π°οΈ HISTORY π°οΈ
ngl this is a lil glow-up story. sbuild-createchroot was previously known as buildd.chroot. iconic name change honestly. buildd.chroot performed exactly the same tasks, but additionally created a number of directories in the chroot for use by sbuild. that part? now handled by schroot(1). so it's not gone, it just moved out. character development π
π AUTHORS π
- Roger Leigh.
- Francesco P. Lovergine.
- Andres Mejia.
the legends themselves. no cap. π«Ά
Β©οΈ COPYRIGHT Β©οΈ
- Copyright Β© 2004 Francesco P. Lovergine <frankie@debian.org>.
- Copyright Β© 2007-2008 Roger Leigh <rleigh@debian.org>.
- Copyright Β© 2010 Andres Mejia <mcitadel@gmail.com>.
π SEE ALSO π
go read these next, iykyk. obsessed with a good cross-reference. π
ok that's the whole page bestie!! this lil masterpiece is Version 0.89.3+deb13u4, dated 28 December 2025, and it's SBUILD-CREATECHROOT(8) β go build something iconic with it πΈπ§β¨
π¦ where this page comes from
- debian trixie: sbuild 0.89.3+deb13u4 Β· GPL-2.0-or-later
- Copyright Β© 2005-2008 Roger Leigh <rleigh@debian.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms