deb-substvars(5)
๐ deb-substvars โ Debian source substitution variables
okay bestie, buckle up ๐ this is the manual page for deb-substvars from the dpkg suite โ yes, that dpkg. It's all about those cute little ${variable} thingies that get swapped out before your control files get written. No cap, it's lowkey iconic.
โจ NAME โจ
deb-substvars โ Debian source substitution variables ๐
โจ SYNOPSIS โจ
debian/substvars, debian/binary-package.substvars, variables
โจ DESCRIPTION โจ
So here's the vibe: before dpkg-source, dpkg-gencontrol and dpkg-genchanges write out their control info โ that's the source control file .dsc for dpkg-source, and standard output for dpkg-gencontrol and dpkg-genchanges โ they do some variable substitutions on the output file. Like a little glow-up pass before it goes out the door. โจ
๐ธ Variable Syntax ๐ธ
A variable substitution has the form ${variable-name}. Variable names are made of alphanumerics (a-zA-Z0-9), hyphens (-) and colons (:), and they start with an alphanumeric. They're case-sensitive, even though they might refer to other entities which are case-preserving. (Yes, the drama of it. ๐
)
Substitutions get performed repeatedly until none are left โ the full text of the field after the substitution is rescanned to look for more substitutions. It's giving recursive, it's giving thorough. ๐ฅ
๐ฆ File Syntax ๐ฆ
Substitution variables can be specified in a file. These files consist of lines with variable assignments that start with the variable name, immediately followed by an assignment operator, and then the value. Each operator gives the variable specific attributes. Trailing whitespace on each line, blank lines, and lines starting with a # symbol (comments) are ignored. ๐ซถ
The following operators are supported:
=โ Assigns a normal substitution variable.?=โ Assigns an optional substitution variable which will emit no warnings even if unused. Supported since dpkg 1.21.8.!=โ Assigns a required substitution variable which will error out if unused. Supported since dpkg 1.22.7.$=โ Assigns an implicit substitution variable which will get automatically instantiated as a field, if that field is not defined for.dscand.debcontrol files.
The variable name needs to be formed as a namespace followed by a colon (:) and then the field name, such as tool:Depends. All implicit variables for any namespace matching the same field will get concatenated using a known field separator, or a space if the field separator is unknown.
Supported since dpkg 1.23.0.
For example:
some-package:Depends?=other-package (= 1.0), the-package
๐ง Substitution ๐ง
Variables can be set using the -V common option. They can also be specified in the file debian/substvars (or whatever other file is specified using the -T common option).
After all the substitutions have been done, each occurrence of the string ${} (which is not an actual substitution variable) is replaced with a $ sign. This can be used as an escape sequence, such as ${}{VARIABLE}, which will end up as ${VARIABLE} on the output. Sneaky but slay. ๐
If a variable is referred to but not defined, it generates a warning and an empty value is assumed. (Rude, but okay. ๐)
While variable substitution is done on all control fields, some of those fields are used and needed during the build when the substitution did not yet occur. That's why you can't use variables in the Package, Source and Architecture fields. Periodt.
Variable substitution happens on the content of the fields after they have been parsed, so if you want a variable to expand over multiple lines you do not have to include a space after the newline. This is done implicitly when the field is output. For example, if the variable ${Description} is set to foo is bar.${Newline}foo is great. and you have the following field:
Description: foo application
${Description}
.
More text.
It will result in:
Description: foo application
foo is bar.
foo is great.
.
More text.
๐ Built-in Variable ๐
Additionally, the following standard variables are always available. Always. ๐
Archโ The current host architecture (i.e. the architecture the package is being built for, the equivalent ofDEB_HOST_ARCH).vendor:Nameโ The current vendor name. This value comes from theVendorfield for the current vendor's origin file, asdpkg-vendor(1)would retrieve it. Supported since dpkg 1.20.0.vendor:Idโ The current vendor ID. This is just the lowercase variant ofvendor:Name. Supported since dpkg 1.20.0.source:Versionโ The source package version. Supported since dpkg 1.13.19.source:Upstream-Versionโ The upstream source package version, including the Debian version epoch if any. Supported since dpkg 1.13.19.binary:Versionโ The binary package version (which may differ fromsource:Versionin a binNMU for example). Supported since dpkg 1.13.19.Source-Versionโ The source package version (from the changelog file). This variable is now obsolete and emits an error when used, as its meaning is different from its function โ use thesource:Versionorbinary:Versionas appropriate. > ๐จ bestie this one is deprecated, don't use it, it literally errors out.source:Synopsisโ The source package synopsis, extracted from the source stanzaDescriptionfield, if it exists. Supported since dpkg 1.19.0.source:Extended-Descriptionโ The source package extended description, extracted from the source stanzaDescriptionfield, if it exists. Supported since dpkg 1.19.0.Installed-Sizeโ The approximate total size of the package's installed files. This value is copied into the corresponding control file field; setting it will modify the value of that field. If this variable is not set,dpkg-gencontrolwill compute the default value by accumulating the size of each regular file and symlink rounded to 1 KiB used units, and a baseline of 1 KiB for any other filesystem object type. With hardlinks only being counted once as a regular file.
๐ญ Note: take into account that this can only ever be an approximation, as the actual size used on the installed system will depend greatly on the filesystem used and its parameters, which might end up using either more or less space than the specified in this field. So likeโฆ it's a vibe, not a promise. ๐
Extra-Sizeโ Additional disk space used when the package is installed. If this variable is set, its value is added to that of theInstalled-Sizevariable (whether set explicitly or using the default value) before it is copied into theInstalled-Sizecontrol file field.S:field-nameโ The value of the source stanza field field-name (which must be given in the canonical capitalization). Setting these variables has no effect other than on places where they are expanded explicitly. These variables are only available when generating binary control files. Supported since dpkg 1.18.11.F:field-nameโ The value of the output field field-name (which must be given in the canonical capitalization). Setting these variables has no effect other than on places where they are expanded explicitly.Formatโ The.changesfile format version generated by this version of the source packaging scripts. If you set this variable, the contents of theFormatfield in the.changesfile will change too. Careful, she's got main character energy. โญNewline,Space,Tabโ These variables each hold the corresponding character.shlibs:dependencyfieldโ Variable settings with names of this form are generated bydpkg-shlibdeps.dpkg:Upstream-Versionโ The upstream version of dpkg. Supported since dpkg 1.13.19.dpkg:Versionโ The full version of dpkg. Supported since dpkg 1.13.19.
โจ FILES โจ
debian/substvarsโ List of substitution variables and values. ๐
โจ SEE ALSO โจ
dpkg(1), dpkg-vendor(1), dpkg-genchanges(1), dpkg-gencontrol(1), dpkg-shlibdeps(1), dpkg-source(1).
and that's the whole page bestie, you ate that ๐ โจ
this masterpiece is from the dpkg suite, version 1.23.11-dirty, dated 2026-09-09 โ go forth and substitute responsibly, ily ๐ซถ๐
๐ฆ 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