Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to have multiple lines for any type of field in a dpkg control file? This is not about line continuation, but e.g. Depends interspersed with Recommends like so:

Depends: git, etckeeper, apt-file
Recommends: equivs
Depends: mplayer, pidgin, dlocate, pwsafe, ciso
Recommends: aria2

And so on. Is this allowed, is it unspecified (and some tool is going to cough on it) or is it explicitly forbidden? (Couldn't find anything in debian-policy, either)

share|improve this question
For sure it's nicer if it's avoided. Can I ask why do you need to know? – Rafał Cieślak Feb 18 '11 at 20:51
The example above is based on the intended application: a metapackage to depend on packages I use. However, there are some packages that are installed "just in case" and haven't seen any use yet. I'd like to somehow encode that while keeping the listing order. – user11080 Feb 19 '11 at 12:24
up vote 3 down vote accepted

No you can't do this. It had never occurred to me to try such a thing, but I took a stab at it. I tried building a package with the following in the debian/control file:

Package: bzr-explorer
Architecture: all
XB-Python-Version: ${python:Versions}
Depends: ${misc:Depends}, ${python:Depends}
Recommends: tango-icon-theme
Suggests: bzr-gtk
Depends: bzr (>= 1.14), qbzr (>= 0.19)
Recommends: bzr-svn
Suggests: bzr-git

dpkg did not like it one bit:

dpkg-source: error: syntax error in bzr-explorer-1.1.2/debian/control at line 24: duplicate field Depends found
dpkg-buildpackage: error: dpkg-source --before-build bzr-explorer-1.1.2 gave error exit status 9
debuild: fatal error at line 1337:
dpkg-buildpackage -rfakeroot -d -us -uc -S failed

In fact, now that I go looking for it, this is explicitly forbidden in Debian Policy, 5.1 Syntax of control files:

A paragraph must not contain more than one instance of a particular field name.

share|improve this answer
Aw, shucks. Of course, a control file can describe more than one package, and they are delimited as paragraphs. I misread that… Extra credit for "at line 1337". – user11080 Feb 19 '11 at 12:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.