parsing upstream version and revision from Ubuntu package Version strings

Stephen Quintero stephen at
Fri Jan 15 21:58:45 UTC 2016

Hi Martin,

Thank you for this clarification.  The situation appears complicated
because Ubuntu receives a package which may or may not include a Debian
revision.  Regardless, if Ubuntu modifies the source, it appends ubuntu*
(no hyphen).  This is what I did not discover through searching and is the
origin of my question.

If I understand correctly, to deconstruct the result in reverse temporal

   1. To find an Ubuntu revision, if any, chop right on ubuntu*
   2. To find a Debian revision, if any, chop right on hyphen
   3. Chop right on ~ and + to remove what is not clear yet
   4. What remains is the original upstream version (optional epoch) from
   which this chain of transformation emerged (it may be a Debian product or
   originate upstream of Debian)

The function of ~ and + are still not entirely clear to me.  It seems:

1.0~foo means derives from version 1.0 preceding commit foo
1.0+foo means derives from version 1.0 succeeding commit foo

So that means?

Best regards,

Stephen Quintero

On Thu, Jan 14, 2016 at 11:21 PM, Martin Pitt <martin.pitt at>

> Hello Stephen,
> Stephen Quintero [2016-01-14 19:00 -0800]:
> > As I understand from the Debian policy manual a package Version string
> > should include the revision, if any, appended after a hyphen to the
> > version, while the version itself should represent the upstream version,
> so
> > that apache2 *2.4.10-8ubuntu2* indicates:
> This is true for packages which have an actual upstream, like Apache.
> > Many packages appear not to conform to this.  For example:
> >
> >    - apt:   *0.8.16~exp12ubuntu10*
> >    - apt:   *1.0.1ubuntu2*
> >    - apt-clone:   *0.3.1~ubuntu11*
> >    - apt-listchanges:   *2.85.13ubuntu2*
> Projects like apt, debian-installer etc. have no "upstream" in that
> sense, they are being developed by the Debian project itself for
> Debian. As such they don't distinguish between an "upstream version"
> and a "Debian revision", and should *not* have a revision number.
> See
> > None of these Version strings have a hyphen to separate any revision.
> Take
> > the last example.  Does it indicate version '2.85.1' revision '3ubuntu2',
> > or version '2.85.13' revision 'ubuntu2', or just version '2.85.13ubuntu2'
> > in which case it is clearly not an upstream version at all.
> Appending "ubuntuX" to the version number (both for versions with
> upstreams and native ones) is the Ubuntu version policy, so that it
> can always be seen which Debian version the Ubuntu package derived
> from. So you can always chop off "ubuntu.*" to get the Debian version.
> > Other package Version strings do have a hyphen separating a revision from
> > the version, but the version is still obviously not the upstream version.
> > For example:
> >
> >    - account-plugins:  *0.11+14.04.20140409.1-0ubuntu1*
> >    - xchat-gnome:
> *1:0.30.0~git20131003.d20b8d+really20110821-0.2ubuntu12*
> >    - x11proto-randr:  **
> Yes, upstream versions can become pretty complicated when doing things
> like "update to the latest upstream snapshot" (common for upstreams
> which are slow to release), or "revert to an earlier version". Much of
> that is coming from the fact that version numbers are required to be
> monotonously increasing, which requires this
> "oldversion+really_newversion" trick.
> Martin
> --
> Martin Pitt                        |
> Ubuntu Developer (  | Debian Developer  (
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Ubuntu-devel-discuss mailing list