$linuxjunkies
>

sbuild(1)

Build Debian packages in a clean chroot environment using schroot.

UbuntuDebianFedoraArch

Synopsis

sbuild [OPTION]... [package.dsc | package.changes | source-package]

Description

sbuild is a tool for building Debian source packages in a clean, isolated chroot environment. It creates reproducible builds by ensuring a consistent build environment free from locally installed packages that might interfere with the build process.

sbuild uses schroot to manage chroot environments and can build for multiple architectures and distributions. It performs dependency checking, installs build dependencies, executes the build, and can optionally sign the resulting packages.

Common options

FlagWhat it does
-d, --dist=DISTBuild for a specific distribution (e.g., bullseye, bookworm, jammy)
-A, --arch=ARCHBuild for a specific architecture (e.g., amd64, i386, arm64)
-c, --chroot=CHROOTUse a specific chroot session (e.g., bullseye-amd64-sbuild)
--sign=KEYIDGPG sign the .changes and .dsc files with the specified key
--sourceBuild source-only package (no binary packages)
--nologDo not create a build log file
--no-run-lintianSkip running lintian after the build completes
--cleanClean up build artifacts in the chroot after building
--force-orig-sourceInclude original source tarball in .changes even if not needed
--batchRun in batch mode without interactive prompts
-v, --verboseIncrease verbosity of output
--stats-dir=DIRWrite build statistics to a file in the specified directory

Examples

Build a package for Debian Bullseye in the default architecture

sbuild -d bullseye package.dsc

Build a package for Debian Bookworm targeting ARM64 architecture

sbuild -d bookworm -A arm64 package.dsc

Build a package and GPG-sign the results with the specified key ID

sbuild -d jammy --sign=0x1234ABCD package.dsc

Build using a specific chroot without creating a log file

sbuild -c bullseye-amd64-sbuild --nolog package.dsc

Build only the source package in batch mode without prompts

sbuild --source --batch mypackage.dsc

Build a package and skip the lintian check after completion

sbuild -d bullseye --no-run-lintian package.dsc

Rebuild a package from a .changes file using the original build settings

sbuild package.changes

Build with verbose output and save build statistics to a file

sbuild -v -d bookworm --stats-dir=~/builds package.dsc

Related commands