Ubuntu – Multiple Depends/Recommends/[…] in a control file

dpkg

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)

Best Answer

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.

Related Question