5

Here is the output of gcc --version :

./gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0

I understand this is version 7.5.0 but why is there the word "Ubuntu" before the version and what does "-3ubuntu1~18.04" after it means exactly in this context (gcc version)?

The manual does not really help me:

   --version
       Display the version number and copyrights of the invoked GCC.

EDIT: Note that I'm not merely asking about what XubuntuY means. I now know this has been answered here. I want to know about the whole string above, including why a version of ubuntu is specified.

2 Answers2

7

You're using gcc version 7.5.0 which is the upstream version.

On supported released products; security fixes are back-ported to the existing package (with few exceptions) so the rest of the detail gives details of the security fixes included in the Ubuntu package.

Useful links - https://packages.ubuntu.com/bionic-updates/gcc-7

where you'll see the changelog link which gives the meaning, ie.

gcc-7 (7.5.0-3ubuntu1~18.04) bionic-proposed; urgency=medium

  • SRU: LP: #1848319. * Backport GCC 7.5.0 to bionic.

-- Matthias Klose doko@ubuntu.com Wed, 04 Dec 2019 15:25:41 +0100

ie. you've got details on the fixes applied that caused that version/package to be created (if you should want/need that information).

guiverc
  • 30,396
2

As I understand it.

The part in brackets is vendor-specific information. The Ubuntu tells you that this is a Ubuntu build of gcc, and the string after it is the package version.

The package version is split into two parts by a hyphen (if there is more than one hyphen the last one is used for the split). The "upstream version" and the "Debian revision" (in some cases there may also be an epoch). The "upstream version", may be the literal version number used upstream or it may contain other indications, for example +dfsg to indicate that non-free files were stripped out of the orig tarball or +git to indicate that what is packaged is actually a git snapshot.

In this case the "upstream version" is "7.5.0" (same as the literal upstream version) and the "Debian revision" is "3ubuntu1~18.04"

Changes in the "Debian revision" identify changes in Debian or it's derivatives that do not change the content of the upstream tarball(s). There are a few basic principles when assigning a version number.

  • It should to the extent possible uniquely identify a version of a package. Obviously this can't be 100% guaranteed with multiple people making packages but there is a generally accepted practice that derivatives should include a unique "tag" in version numbers they assign.
  • When a release is updated, the version number must increase (according to the comparison rules) so that users actually get the upgrade.
  • When a package is in multiple releases of a distro, the version in newer releases must be higher than in older releases so that users who upgrade their systems get the correct version.
  • It should be meaningful to users.

The tilde character in version numbers is special, in the version comparision algorithm it compares lower than the empty string, that is "1.2.3-2~foo" < "1.2.3-2" < "1.2.3-2foo" it is commonly used when backporting a package to an earlier release, it is also used to represent prerelease versions.

So now lets break the "Debian revision" of this package down.

  • "3" is the revision from Debian itself, indicating that the Debian package this Ubuntu package was based on was the third revision they made to their packaging for 7.5.0.
  • "ubuntu1" indicates that this package was modified by Ubuntu.
  • ~ generally indicates this is a backport of some sort.
  • 18.04 appears to indicate what release this package was backported to. This appears from what I can tell to be ad-hoc usage. There are standards for how backports uploaded to the backports repository should be versioned, but this backport was released as a stable update not through the backports repository. The stable update process does not seem to mandate a particular versioning scheme, it suggests using the one from the security updates process, but that doesn't seem to cover the case of a backported package.
Peter Green
  • 1,841
  • 1
  • 12
  • 15