sbuild(1)
Build Debian packages in a clean chroot environment using schroot.
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
| Flag | What it does |
|---|---|
-d, --dist=DIST | Build for a specific distribution (e.g., bullseye, bookworm, jammy) |
-A, --arch=ARCH | Build for a specific architecture (e.g., amd64, i386, arm64) |
-c, --chroot=CHROOT | Use a specific chroot session (e.g., bullseye-amd64-sbuild) |
--sign=KEYID | GPG sign the .changes and .dsc files with the specified key |
--source | Build source-only package (no binary packages) |
--nolog | Do not create a build log file |
--no-run-lintian | Skip running lintian after the build completes |
--clean | Clean up build artifacts in the chroot after building |
--force-orig-source | Include original source tarball in .changes even if not needed |
--batch | Run in batch mode without interactive prompts |
-v, --verbose | Increase verbosity of output |
--stats-dir=DIR | Write build statistics to a file in the specified directory |
Examples
Build a package for Debian Bullseye in the default architecture
sbuild -d bullseye package.dscBuild a package for Debian Bookworm targeting ARM64 architecture
sbuild -d bookworm -A arm64 package.dscBuild a package and GPG-sign the results with the specified key ID
sbuild -d jammy --sign=0x1234ABCD package.dscBuild using a specific chroot without creating a log file
sbuild -c bullseye-amd64-sbuild --nolog package.dscBuild only the source package in batch mode without prompts
sbuild --source --batch mypackage.dscBuild a package and skip the lintian check after completion
sbuild -d bullseye --no-run-lintian package.dscRebuild a package from a .changes file using the original build settings
sbuild package.changesBuild with verbose output and save build statistics to a file
sbuild -v -d bookworm --stats-dir=~/builds package.dsc