SBUILD-CREATECHROOT(8)
π SBUILD-CREATECHROOT(8) π
okay bestie, welcome to Debian sbuild's little chroot-bakery. this whole page is gonna be long so buckle up, we're doing part 1 of 2. β¨
πΈ NAME πΈ
sbuild-createchroot β make an sbuild chroot, no cap π«Ά
β¨ SYNOPSIS β¨
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 π
ok first things first, real talk: this tool is only useful for the schroot backend. Debian buildds switched over to the unshare backend back in 2024. so like, noted. π
so basically sbuild-createchroot runs debootstrap(1) to cook up a chroot that's all set for building packages with sbuild. and yeah, you could just run debootstrap yourself, but no β sbuild-createchroot does extra bonus setup stuff, like adding extra packages and configuring a bunch of files inside the chroot. it's literally the same as running:
debootstrap --variant=buildd --include=fakeroot,build-essential
and then hand-editing /etc/apt/sources.list and /etc/hosts yourself. like, imagine. π
the freshly-made chroot gets set up to vibe with schroot(1) by creating a chroot definition file under /etc/schroot/chroot.d. bestie, you still gotta edit that thing to actually finish the config once sbuild-createchroot is done. it's giving "almost there" energy.
now β buildd-create-chroot, just like sbuild-createchroot, runs debootstrap(1) to make a chroot for package building. BUT π it makes one specifically for buildd(1), and it's got an extra mandatory option where you specify a user who gets sudo access inside the chroot. the main difference? it also customises /etc/apt/sources.list to use incoming.debian.org and security-master.debian.org. and it removes some packages from the newly-created chroot too. so unless you're literally setting up an official Debian build daemon, just use sbuild-createchroot instead. the extra functionality is gonna get merged into sbuild-createchroot in the future. π¦
π OPTIONS π
π Actions π
-h,--helpβ shows you this whole manual. hi. π-V,--versionβ prints version info. the receipts. π§Ύ
π General options π
-v,--verboseβ prints all the messages. everything. the whole tea. β
π Debootstrap options π
heads up bestie: debootstrap(1) is the canonical reference for what these actually mean β they get passed straight through to debootstrap. i'm just the messenger. π«‘
--arch=archβ sets the target architecture. you'd use this ifdpkgisn't already installed. also go peek at--foreignbelow, they're friends. π―--chroot-suffix=suffixβ adds a custom suffix to the chroot name. defaults to-sbuild.--chroot-prefix=prefixβ adds a custom prefix to the chroot name. defaults to SUITE. this is iconic for making variants of a base suite, likestretch-backports, where you manually add the backports archive after the base chroot was made usingsbuild-shell. that way a normalstretchchroot and astretch-backportschroot can exist side-by-side. and honestly it's not just for that β you can use it to make chroots with literally any other type of customisation. it's a shortcut so you don't have to create a base chroot and then manually copy it and edit the config files like a peasant. slay. β¨--chroot-mode=schroot|sudo|unshareβ picks the sbuild chroot backend to generate the chroot for. theautopkgtestbackend is not supported by this method, because of all the wild container types it handles. to generate a chroot forschrootandsudo,sbuild-createchrootmust be run with superuser privileges (like, usesudo). for backwards compatibility reasons, choosingschrootimpliessudoβ but not the other way round. choosingunsharerequires the--make-sbuild-tarballoption. making a chroot for the unshare backend can be done by a normal user (no sudo needed!), but it requires Linux user namespaces to be enabled, viasysctl -w kernel.unprivileged_userns_clone=1. chroot tarballs made for the unshare backend are also compatible with the schroot backend if you manually create the respective schroot config file, or by runningsbuild-createchrootwith the--setup-onlyoption. defaults toschroot. π--foreignβ only does the initial unpack phase of bootstrapping. you need this if the target and host architectures don't match. note that debootstrap then requires running by hand to finish installation β run thedebootstrap/debootstrap/debootstrapinstalled in TARGET-DIRECTORY to complete the installation. π€--resolve-depsβ automatically resolves missing dependencies. this is the default. π₯--no-resolve-depsβ does not automatically resolve missing dependencies. π--keep-debootstrap-dirβ doesn't delete the/debootstrapdirectory in TARGET-DIRECTORY after the installation finishes.--debootstrap=debootstrapβ defines a custom debootstrap variant. defaults todebootstrap.--include=package1[,package2,[packagen]]β comma-separated list of packages that get added to the list of packages to download and extract.--exclude=package1[,package2,[packagen]]β comma-separated list of packages that get removed from the list of packages to download and extract.
β οΈ bestie, careful: this can remove essential packages. use with extreme care. like, extreme extreme. π
--components=component1[,component2,[componentn]]β comma-separated list of archive components to use (e.g. βmainβ, βcontribβ, βnon-freeβ). defaults to βmainβ.--keyring=keyring-fileβ downloads signatures for retrieved Release files and checks them against keyring-file. by default/etc/apt/trusted.gpgis used. set it to an empty string to disable signature checking. π§--merged-usrβ creates a chroot where/bin,/sbinand/lib*are symbolic links to their counterparts in/usr.--no-merged-usrβ creates a chroot where/bin,/sbinand/lib*are ordinary directories, distinct from their counterparts in/usr.--auto-merged-usrβ doesn't specify whether/bin,/sbinand/lib*are symlinks to their counterparts in/usr. in that case debootstrap just uses its default behaviour, which is suite-specific. this is the default. πΈ- SUITE β the distribution to bootstrap (e.g. βstretchβ, βbusterβ, βbullseyeβ, βsidβ). a complete list lives in
/usr/share/debootstrap/scripts. π - TARGET-DIRECTORY β the directory to create the chroot in. it gets created if it doesn't already exist. no worries. β¨
- DEBIAN-MIRROR-URI β an
http://,file:///, orssh:///URI pointing to a suitable archive mirror. defaults tohttp://deb.debian.org/debian. - SCRIPT β debootstrap script to run. not typically required. (main character energy only for the defaults, honestly.)
π sbuild-createchroot behaviour π
--setup-onlyβ doesn't run debootstrap. only does the setup tasks on an already-existing chroot. super useful for converting an existing chroot for use with sbuild, one you already made with a tool like debootstrap. some configuration steps can only happen on a directory chroot, so heads up: this option is not useful with the unshare backend. π--make-sbuild-tarball=fileβ creates a bootstrapped file type chroot ready to go with sbuild, and saves it as file. the compression format used for the tarball depends on the file extension you use in file. go check the TARBALL FILE section for the details. π--keep-sbuild-chroot-dirβ doesn't delete the directory used for creating a file type chroot. this option does literally nothing if you're not creating a file type chroot. π--no-deb-srcβ doesn't add adeb-srcline to the/etc/apt/sources.listfile in the TARGET-DIRECTORY after the debootstrap process. useful when you know sbuild will never have to download the source package itself, and is always handed an already-downloaded dsc. in that case this option saves bandwidth and disk space, because the source indices don't have to be downloaded and then continually updated forever and ever. πΎ--alias=aliasβ adds an alternative name the chroot will be known by. you can give this option multiple times to add more than one alias. aliases are great for chroots of distributions known by more than one name β for example, Debian unstable is also known as sid. also, sbuild picks the distribution by the latest changelog entry, which could listUNRELEASEDfor packages the maintainer is still working on. so for Debian it 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 instead. see the EXAMPLES section for how to actually use this in practice. π--extra-repository=specβ adds a repository to the list of apt sources. the repository specification is a line suitable for anapt sources.list(5)file. for instance you might use--extra-repository="deb http://deb.debian.org/debian experimental main"to let packages in the experimental distribution 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β sets the chroot command-prefix option as specified. a common use-case is specifyingeatmydata, which stops all commands executed in the chroot from syncing data to disk (obsessed π½οΈ). this option is only allowed when choosing--chroot-mode=schroot. seeschroot.conf(5)for more details.
part 2 is coming bestie, don't go anywhere π¦β¨
π TARBALL FILE π
okay bestie so here's the thing about making an sbuild tarball file β the compression format you get depends entirely on the extension you slap on the filename. no cap. here's the whole detection list and what each one gives you π
*.tarβ gives you an uncompressed tarball. raw. unfiltered. just vibes.*.tar.gz|*.tgzβ gives you a compressed tarball using gzip β¨*.tar.bz2|*.tbzβ gives you a compressed tarball using bzip2*.tar.lz|*.tlzβ gives you a compressed tarball using lzip*.tar.xz|*.txzβ gives you a compressed tarball using xz π¦
bestie listen. if you specify no extension at all,sbuild-createchrootwill literally rename file to file.tar.gzand then generate file.tar.gzas a compressed tarball using gzip. it's giving "i'll do it myself" π gzip is the default, periodt.
π EXAMPLES π
β¨ the bootstrapped unstable-with-sbuild-and-schroot situation β¨
to create a bootstrapped file type sid (unstable) chroot that's ready for use with sbuild and schroot (which is the default backend), saved in /srv/chroot/unstable-amd64.tar.gz, using the deb.debian.org Debian http mirror redirector service, and with 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β΅
π plain schroot energy π
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β΅
π backports bestie π
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β΅
π§ experimental with a custom prefix π§
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β΅
π no sudo required, main character energy π
creating a chroot for the unshare backend does not require superuser privileges (no sudo, bestie!! π). the path for the tarball here is the default path that sbuild actually expects 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 π
not me giving you the lore but like β sbuild-createchroot was previously known as buildd.chroot. bestie we're talking a full rebrand. π
buildd.chroot performed exactly the same tasks, but on top of that it additionally created a number of directories in the chroot for use by sbuild. that part is now the job of schroot(1) β it moved out and honestly it's thriving. πΈ
π AUTHORS π
- Roger Leigh.
- Francesco P. Lovergine.
- Andres Mejia.
the icons. the legends. π«Ά
π 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 πΈ
iykyk, go read those next bestie π
okay that's the whole page!! this was Version 0.91.10ubuntu1, dated 29 June 2026, and it's the SBUILD-CREATECHROOT(8) manual β go forth and build chroots, you absolute icon π
β¨π
π¦ where this page comes from
- ubuntu stonking: buildd 0.91.10ubuntu1 Β· GPL-2.0-or-later
- Copyright Β© 2005-2008 Roger Leigh <rleigh@debian.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms