Score:5

What does the output of gcc --version mean

gr flag

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.

muru avatar
us flag
Does this answer your question? [What is the meaning of the XubuntuY string in Ubuntu package names?](https://askubuntu.com/questions/620533/what-is-the-meaning-of-the-xubuntuy-string-in-ubuntu-package-names)
Emile Papillon-Corbeil avatar
gr flag
@muru Only partially, since it does not explain the whole string (Ubuntu 7.5.0-3ubuntu1~18.04), only the XubuntuY part. My current understanding is that this is gcc version 7.5.0 distributed in a Debian package. The package is at its 3rd revision for Debian, 1st for Ubuntu. Why is it also stating a version of Ubuntu ?
muru avatar
us flag
Because you can have the same GCC version built for multiple versions of Ubuntu (check [the changelog](https://changelogs.ubuntu.com/changelogs/pool/main/g/gcc-7/gcc-7_7.5.0-3ubuntu1~18.04/changelog) - you can see this version was originally packaged for 20.04 and backported to 18.04)
Score:7
cn flag

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 [email protected] 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).

Score:2
cm flag

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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.