I'm building my software into a deb package using the standard devscripts, and I would like to use dch to automatically increment the release number for non-source code changes (i.e. packaging changes and patches), as it is common in Linux distributions.

For example: the source release is 1.0.0 and I'm packaging the software as 1.0.0-1 (the first packaged release of version 1.0.0). Now I discovered a bug in the packaging (for example, a configuration file was not marked as such), so I want to release package version 1.0.0-2.

Initially I though that dch -i is ideal for this, but apparently it increments from 1.0.0-1 to 1.0.0-1ubuntu1 :-( . I've looked hard into what other command line options I can use, but all I could find was options to use a different suffix (e.g. --rebuild will add buildX).

Mush I edit the release number manually every time?


To release 1.0.0-2 you need to use the -U option, see dch man page:

   --upstream, -U
          Don't append distro-name1 to the version on a derived          
          distribution. Increment the Debian version.

Initial debian/changelog:

foo (1.0.0-1) trusty; urgency=medium

  * Initial release

 -- Sylvain Pineau <sylvain.pineau@canonical.com>  Thu, 16 Jul 2015 14:53:54 +0200

After dch -U:

foo (1.0.0-2) UNRELEASED; urgency=medium


 -- Sylvain Pineau <sylvain.pineau@canonical.com>  Thu, 16 Jul 2015 18:06:24 +0200

foo (1.0.0-1) trusty; urgency=medium

  * Initial release

 -- Sylvain Pineau <sylvain.pineau@canonical.com>  Thu, 16 Jul 2015 14:53:54 +0200
| improve this answer | |
  • Thanks, that works. The naming convention really throws me off - so am I to understand that "Debian version" is what RPM calls "release version" ? – Guss Jul 16 '15 at 20:21
  • @Guss: See debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version for the full reference about the Debian version policy. – Sylvain Pineau Jul 16 '15 at 20:24
  • 1
    Got it. Though -U doesn't work well for me: sometime it does what I want and sometimes it doesn't increment the "Debian version" and just adds another line to the last changelog entry without incrementing the version. -i always increments. Frustrating. – Guss Jul 16 '15 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.