apt-extracttemplates
Extract configuration templates from Debian packages
SYNOPSIS
apt-extracttemplates package.deb
PARAMETERS
package.deb
Path to the local Debian package file (.deb) to extract templates from
DESCRIPTION
apt-extracttemplates is a utility in the apt-utils package for Debian-based systems. It extracts Debconf configuration templates from a local .deb package file without unpacking or installing the package.
Debconf templates (DEBIAN/templates) define questions, choices, and defaults used by package maintainers' scripts during installation to configure software interactively or non-interactively. This tool reads the control archive of the .deb, locates the templates, and prints them to stdout.
Ideal for previewing config prompts before deployment, auditing packages, or scripting installations with preseeding. For example, review templates to prepare debconf-set-selections for automated installs.
Simple and lightweight, it integrates with APT ecosystem but requires only local files—no repo access.
CAVEATS
Requires apt-utils installed.
Only local .deb files; no remote/package name support.
Outputs raw templates to stdout—redirect with > for files.
Fails if no templates in package.
EXAMPLE
apt-extracttemplates foo_1.0-1_amd64.deb > foo.templates
Saves extracted templates to foo.templates for review or preseeding.
OUTPUT FORMAT
YAML-like Debconf syntax with Template blocks, e.g.:
Template: foo/example
Type: boolean
Default: false
Description: Enable foo?
HISTORY
Introduced in apt-utils around Debian 3.0 (2002), as APT matured for advanced package handling. Enhanced with debconf integration in later versions for better pre-install config inspection.


