dpkg-buildtree(1)
π dpkg-buildtree β bestie's guide β¨
okay so real talk, this is the dpkg-buildtree manual page from the dpkg suite, and it's actually so much simpler than it looks. it's a helper for build tree operations during package builds. let me walk you through it π«Ά
β¨ NAME β¨
dpkg-buildtree β helper for build tree operations during package builds
like, the ultimate little sidekick for your build tree. no cap π
πΈ SYNOPSIS πΈ
dpkg-buildtree [option...] [command]
that's it. options, then a command. iconic and minimal π
π¦ DESCRIPTION π¦
so dpkg-buildtree is a tool that performs common operations on the build tree for a source package. that's the whole vibe β it does the recurring chores so you don't have to think about them π§Ήβ¨
this program was introduced in dpkg 1.22.3. mark your calendars bestie π
π COMMANDS π
here's where it gets fun. pick your fighter:
cleanβ removes all artifacts generated during a build by the various dpkg tools, plus pathnames used or controlled by dpkg tools that are safe to clean. ngl these files are used to track state between package build runs, and in many cases they're straight-up internal implementation details the packager should not be concerned about, or they're staging directories containing build artifacts. so yeah β it yeets all of that ποΈπ¨is-rootlessβ checks whether the build tree can be built with no root privileges. the way this one is designed to be safe though?? you can use it safely even with versions where the command was not yet available, because the default will then be the historic one where root was required. so no breaking πβ¨
supported since dpkg 1.22.12 π«Ά
--helpβ show the usage message and exit. your classic escape hatch π--versionβ show the version and exit. slay, show me the lore β
π ENVIRONMENT π
DPKG_COLORSβ sets the color mode. the currently accepted values are:auto(default),alwaysandnever. yes bestie, you can force the rainbow ππDPKG_NLSβ if set, it will be used to decide whether to activate Native Language Support, also known as internationalization (or i18n) support. the accepted values are:0and1(default). global girlie behavior πβ¨
π FILES π
π§Ί Cleaned files
debian/filesdebian/files.new
β files generated by dpkg-distaddfile(1). cute, but they get cleaned π
debian/substvarsdebian/substvars.new
β files generated by dpkg-shlibdeps(1). also getting cleaned, sorry babes π«Ά
debian/tmp
β staging directory containing the contents to be used when creating a package. both dpkg-gencontrol(1) and dpkg-gensymbols(1) generate files within. so it's like the communal closet of the build and clean empties it πͺβ¨
π EXAMPLES π
π§ Usage in debian/rules
okay so you can call dpkg-buildtree clean from the debian/rules clean target, after having performed other necessary cleanups. order matters bestie, do the other stuff first π₯
for example, for an autoconf-like build system:
clean:
[ ! -f Makefile ] || $(MAKE) distclean
dpkg-buildtree clean
see? distclean if there's a Makefile, then dpkg-buildtree clean. chef's kiss π€πΈ
and that's the whole page, bestie. go forth and clean responsibly πβ¨
dpkg-buildtree(1)β dpkg suite, version1.23.11-dirty, dated2026-09-09. periodt. π π
π¦ where this page comes from
- arch rolling: dpkg 1.23.11-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms