DH_INSTALLDEBCONF(1)
okay bestie, welcome to dh_installdebconf π β it's page 1 of the Debhelper manual, and she's here to handle all ur debconf business so you don't have to πβ¨
π NAME π
dh_installdebconf β install files used by debconf in package build directories π¦
β¨ SYNOPSIS β¨
dh_installdebconf [debhelper options] [-n] [-- params]
π DESCRIPTION π
okay so dh_installdebconf is a debhelper program, and her whole job β her entire moment, her main character arc β is installing the files that debconf needs into ur package build directories πΈ
she ALSO auto-generates the postrm commands you need to talk to debconf, no cap. those commands get added into the maintainer scripts by dh_installdeb. if you wanna know how that whole thing works, go read dh_installdeb(1) β she explains it π«Ά
note bestie: if you're using debconf, ur package probably needs to depend on it. (this program will add it to ${misc:Depends} for you, so slay π
)
another note: for ur config script to actually get called bydpkg, urpostinstneeds to source debconf'sconfmodule.dh_installdebconfdoes NOT install that statement into thepostinstautomatically β because it's genuinely too hard to do it right π fr fr.
ποΈ FILES ποΈ
debian/package.config
this is the debconf config script, and it gets installed into the DEBIAN directory inside the package build directory β¨
inside the script, the token #DEBHELPER# gets replaced with shell script snippets generated by other debhelper commands π
debian/package.templates
this is the debconf templates file, and it gets installed into the DEBIAN directory inside the package build directory π
debian/po/
if this directory is present, this program will automatically use po2debconf(1) to generate merged templates files that include the translations from in there π
for that to work, ur package should build-depend on po-debconf π¦
βοΈ OPTIONS βοΈ
-n,--no-scriptsβ do not modify thepostrmscript. hands off, she's not touching it π-- paramsβ pass the params topo2debconfπ-DTOKEN=VALUE,--define TOKEN=VALUEβ define tokens to be replaced inside the maintainer scripts when it's generated. pls note that the limits described in "Limitations in token names" also apply to tokens defined on the command line, and invalid token names will trigger an error π
in the simple case, this parameter makes #TOKEN# get replaced by VALUE. if VALUE starts with a literal @-sign, then VALUE is expected to point to a file containing the actual value to insert π
an explicitly declared token with this parameter will replace built-in tokens π
test examples to aid with the understanding (not me giving you homework, just receipts):
cat >> debian/config <<EOF
#SIMPLE#
#FILEBASED#
EOF
echo -n "Complex value" > some-file
dh_installdeb --define SIMPLE=direct --define FILEBASED=@some-file
in this example, #SIMPLE# will expand to direct and #FILEBASED# will expand to Complex value β¨
it's also possible to set package-specific values for a given token. this is useful when dh_installdebconf is acting on multiple packages that need different values for the same token. you do this by prefixing the token name with pkg.package-name. π
this can be used as in the following example:
cat >> debian/foo.config <<EOF
# Script for #PACKAGE#
#TOKEN#
EOF
cat >> debian/bar.config <<EOF
# Script for #PACKAGE#
#TOKEN#
EOF
cat >> debian/baz.config <<EOF
# Script for #PACKAGE#
#TOKEN#
EOF
dh_installdebconf -pfoo -pbar -pbaz --define TOKEN=default --define pkg.bar.TOKEN=unique-bar-value \
--define pkg.baz.TOKEN=unique-baz-value
in this example, #TOKEN# will expand to default in debian/foo.config, to unique-bar-value in debian/bar.config and to unique-baz-value in debian/baz.config π
note that the #pkg.*# tokens will be visible in all scripts acted on. e.g. you can refer to #pkg.bar.TOKEN# inside debian/foo.config and it will be replaced by unique-bar-value π
π SUBSTITUTION IN MAINTAINER SCRIPTS π
dh_installdebconf will automatically replace the following tokens inside a provided maintainer script (as long as they weren't already replaced via -D/--define) π«Ά
#DEB_HOST_NAME#,#DEB_BUILD_NAME#,#DEB_TARGET_NAME#β these tokens get replaced with the respective variable fromdpkg-architecture(1). in almost all cases you will want to use the#DEB_HOST_NAMEvariant in a script to ensure you get the right value when cross-building π
on a best effort, tokens of this pattern that do not match a variable in dpkg-architecture(1) will be left as-is.
#ENV.NAME#β these tokens of this form get replaced with the value of the corresponding environment variable. if the environment variable is unset, the token is replaced with the empty string π³οΈ
note that there are limits on which names can be used (see "Limitations in token names").
#PACKAGE#β this token is by default replaced by the package name, which will contain the concrete script π¦
π§ Limitations in token names π§
all tokens intended to be substituted must match the regex:
#[A-Za-z0-9_.+]+#
tokens that do not match that regex will be silently ignored if found in the script template πΆβπ«οΈ. invalid token names passed to -D or --define will cause dh_installdebconf to reject the command with an error in most cases π
π SEE ALSO π
this program is a part of debhelper π
π AUTHOR π
Joey Hess <joeyh@debian.org>
and that's the whole page bestie, we ate and left no crumbs πβ¨ this was version 14.5ubuntu1, dated 2026-09-21 β go forth and debconf responsibly ππ¦π
π¦ where this page comes from
- ubuntu stonking: debhelper 14.5ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms