What does the colon (:) and dash (-) in an Ubuntu dpkg version number mean?

Debian policy manual

Both of these are covered in: https://www.debian.org/doc/debian-policy/#version which is also reproduced in:

man deb-version

Those manuals say that the full format is:

[epoch:]upstream_version[-debian_revision]

epoch

The manual says:

It is provided to allow mistakes in the version numbers of older versions of a package, and also a package’s previous version numbering schemes, to be left behind.

For example, suppose that the original package had versions:

  • 2019.1
  • 2019.2
  • 1.2 (original package decided to randomly change the release naming scheme)
  • 1.3

Then Debian treats those as:

  • 0:2019.1 (commonly known simply as 2019.1 because the leading 0: can be omitted)
  • 0:2019.2
  • 1:1.2 (Debian bumps the epoch from 0 to 1 to deal with the new naming scheme)
  • 1:1.3

This way we can still know the version order clearly from the package version string, or be able to differentiate them at all if the original package makes the cardinal sin of actually reusing an old name release in the new scheme.

Can you imagine the type of Hellish things that Debian developers have had to accommodate for? :-)

debian_revision

The manual says:

This part of the version number specifies the version of the Debian package based on the upstream version

The Debian revision is needed for Debian due to changes on the build scripts/patches that the Debian package itself uses on top of the software's source itself.

-ubuntuY

Ubuntu can also add an -ubuntuY suffix to account for changes made on the Ubuntu packaging over the Debian packaging.

So for example, 4:4.7.4-0ubuntu8 means that this is the 8th version of the Ubuntu package that is based on the 4:4.7.4 Debian package.

This is because Ubuntu takes Debian as base, but it can also add additional changes on top.

The 0 there just acts as a placeholder when the Debian package does not have a number, since the debian_revision is optional.

More details at: https://serverfault.com/questions/604541/debian-packages-version-convention/708569#708569


The number before the : is the epoch. This overrides the version for ordering purposes, e.g. 3:3.1 is considered newer than 2:3.2. It's used when a packager needs to downgrade a package in the repos for one of various reasons.

The number (value, really) after the - is the release. It differentiates between different releases of a package that have the same version. It's used for e.g. security patches to an existing version of the software.