LinuxCommandLibrary

debuild

Build Debian packages from source code

TLDR

Build the package in the current directory

$ debuild
copy

Build a binary package only
$ debuild -b
copy

Do not run lintian after building the package
$ debuild --no-lintian
copy

SYNOPSIS

debuild [options] [dpkg-buildpackage options]

PARAMETERS

-us
    Build unsigned source package (skip dpkg-source --sign)

-uc
    Build unsigned changes/buildinfo file (skip debsign)

--no-check-builddeps
    Skip checking for build dependencies

--no-check-dirname
    Skip checking source directory name regex

--lintian
    Run lintian on resulting packages

--lintian-opts OPTS
    Pass options to lintian

-i REGEX
    Check directory name against regex; default --check-dirname

-I REGEX
    Ignore files matching regex during clean

--no-taint
    Skip fakechroot or root checks

-S
    Build source-only package

-sa
    Build source and all binary packages

--pbuilder
    Use pbuilder for chroot build

--sbuild
    Use sbuild for chroot build

-jJOBS
    Pass parallel jobs to dpkg-buildpackage

--check-param
    Override parameter checks

--source-option=OPTION
    Extra dpkg-source options

--buildinfo-option=OPTION
    Extra dpkg-genbuildinfo options

--changelog
    Force changelog checks

DESCRIPTION

Debuild is a powerful wrapper script from the devscripts package designed for Debian package maintainers. It automates the process of building binary and source packages from a Debian source tree. Key features include cleaning the source directory, verifying build dependencies with tools like dpkg-checkbuilddeps, invoking dpkg-buildpackage (often with fakeroot), running lintian for quality checks, and optionally signing the resulting .dsc and .changes files with dpkg-source --build and dpkg-genchanges.

Typically run from the root of a Debian source package directory (containing debian/ subdirectory), debuild streamlines workflows by handling common pitfalls like dirty trees or missing dependencies. It supports clean builds, parallel compilation via DEB_BUILD_OPTIONS, and integration with pbuilder or sbuild for chroot-based builds. Widely used in Debian, Ubuntu, and derived distributions for reliable, reproducible package construction.

Debuild ensures compliance with Debian packaging standards, making it essential for contributors uploading to repositories.

CAVEATS

Must run from Debian source root (with debian/ dir); requires build dependencies installed or handled via --no-check-builddeps; resource-intensive for large packages; assumes devscripts installed; unsigned builds (-us/-uc) recommended for testing only.

COMMON USAGE

debuild -us -uc for local unsigned build.
debuild --no-lintian to skip checks.
debuild binary or debuild -b for binaries only.

EXIT CODES

0: success; 1-2: warnings/failures from underlying tools; 29: build deps missing; consult man debuild for details.

HISTORY

Introduced in Debian's devscripts package around 1999-2000 by Raphael Hertzog and others; evolved with Debian packaging standards (e.g., multi-binary support, build profiles); actively maintained, with major updates for reproducible builds (2010s) and new tools like debuild --reprotest.

SEE ALSO

dpkg-buildpackage(1), dpkg-source(1), lintian(1), dpkg-checkbuilddeps(1), devscripts(1), pbuilder(1), sbuild(1)

Copied to clipboard