# man > dpkg-gencontrol(1)

---
type: CommandReference
command: dpkg-gencontrol
mode: man
section: 1
source: man-pages
---

## Quick Reference

- `dpkg-gencontrol -v<version>` — Set binary package version
- `dpkg-gencontrol -p<package>` — Generate info for a specific binary package
- `dpkg-gencontrol -T<file>` — Read substitution variables from file
- `dpkg-gencontrol -D<field>:<value>` — Override/add a control file field
- `dpkg-gencontrol -U<field>` — Remove a control file field
- `dpkg-gencontrol -O` — Print control file to standard output

## Name

**dpkg-gencontrol** — generate Debian control files

## Synopsis

**dpkg-gencontrol** [_option_...]

## Description

**dpkg-gencontrol** reads information from an unpacked Debian source tree and generates a binary package control file (default: `debian/tmp/DEBIAN/control`). It simplifies relation fields (`Pre-Depends`, `Depends`, `Recommends`, `Suggests`) by removing dependencies known to be true from stronger dependencies, and removes self-dependencies. It computes the intersection of multiple dependencies on the same package. Other relation fields (`Enhances`, `Conflicts`, `Breaks`, `Replaces`, `Provides`) are simplified by computing the union of dependencies when a package is listed multiple times. It also adds an entry for the binary package to `debian/files`.

## Options

### Package Selection and Version

- `-v <version>` — Set the version number of the generated binary package
- `-p <package>` — Generate information for the specified binary package (required if source control file lists more than one binary package)

### Substitution Variables

- `-V <name>=<value>` — Set an output substitution variable (see `deb-substvars(5)`)
- `-T <substvars-file>` — Read substitution variables from file (default: `debian/substvars`); can be used multiple times

### Control File Field Manipulation

- `-D <field>:<value>` — Override or add an output control file field
- `-U <field>` — Remove an output control file field

### File Paths and Output

- `-c <file>` — Specifies the main source control file (default: `debian/control`)
- `-l <file>` — Specifies the changelog file (default: `debian/changelog`)
- `-f <file>` — Read/write the list of files to be uploaded here (instead of `debian/files`)
- `-F <changelog-format>` — Specifies the format of the changelog (see `dpkg-parsechangelog(1)`)
- `-n <filename>` — Assume the package filename will be `<filename>` instead of the normal `package_version_arch.deb`
- `-P <package-build-dir>` — Scan specified build directory instead of `debian/tmp`; also affects default `Installed-Size` and output file location
- `-O [<filename>]` — Print control file to standard output (or to `<filename>` if specified, since dpkg 1.17.2) instead of `debian/tmp/DEBIAN/control`

### Deprecated Options

- `-is`, `-ip`, `-isp` — Ignored for compatibility (previously used to include Section/Priority fields, now default)

### Help and Version

- `-?`, `--help` — Show usage message and exit
- `--version` — Show version and exit

## Environment

- `DPKG_COLORS` — Set color mode: `auto` (default), `always`, `never` (since dpkg 1.18.5)
- `DPKG_NLS` — If set to `0` or `1`, controls Native Language Support (i18n) (since dpkg 1.19.0)

## Files

- `debian/control` — Main source control information file
- `debian/files` — List of generated files for the upload; `dpkg-gencontrol` adds binary package filenames here

## See Also

- [deb-substvars(5)](https://www.chedong.com/phpMan.php/man/deb-substvars/5/markdown)
- [deb-src-control(5)](https://www.chedong.com/phpMan.php/man/deb-src-control/5/markdown)
- [deb-changelog(5)](https://www.chedong.com/phpMan.php/man/deb-changelog/5/markdown)
- [deb-control(5)](https://www.chedong.com/phpMan.php/man/deb-control/5/markdown)