I'd like to package software for easy company-internal deployment, but I'm not sure which version strings to assign. I read this explanation on how it works. However, I'm still not 100% sure. Let's say I want to build my own version of fail2ban for Ubuntu 16.04.1 directly from the source. So my package would not be based on any Debian version. Does that mean I have to set the revision to 0 and add ubuntuY (Y being the Yth revision of my own version)?

Sometimes I see packages with the the Ubuntu version at the end, e.g. ubuntu16.04.1. When would it make sense to do that?

And one last thing: if I look at Ondřej Surýs PHP PPA, the version numbers look really crazy, e.g. 5.6.37-1+ubuntu16.04.1+deb.sury.org+1. What does all that mean after the plus sign?


You can use any alphanumeric character string you like that achieves your goal. You are not limited to specific strings.

The purpose of the Ubuntu0 string is simply to make clear the origin of the package - that it's an Ubuntu-specific rebuild (usually due to a patch) instead of a new upstream version. Note that the Ubuntu0 is simply an alphanumeric string, not a magic incantation. It's higher than Uakari and lower than Uckerland.

For example: If you want your custom package to be overwritten by the next security upgrade, then set the version number rather low: fail2ban

Since ~A is higher than nothing, it will supersede the current 18.04 Ubuntu package. However, a potential future Ubuntu security or bugfix version ~Ubuntu0 is higher than ~A, and will supersede your custom package.

For example: If you don't want your package to be overwritten by a security upgrade, but do want it to be overwritten by the next release-upgrade, then set the version number higher: fail2ban ~X is higher than ~U, so Ubuntu updates won't supersede. But the next upstream release of 0.10.4 will supersede your custom package.

If you don't want any package to ever supersede your custom package, then use apt-pinning or apt-marking or Snaps instead of mucking with version strings.

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.