5

In attempting to find the version of Debian I am running, I have run several commands; the confusing thing is, nearly all of these commands return different results.

For instance, in /proc/version I find:

Linux version 3.2.0-4-686-pae (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.2.63-2+deb7u2

I can tell 3.2.0-4-686-pae is the kernel version, this is clear to me. But the rest of the output seems to give two different Debian version numbers of 4.6.3-14 and 3.2.63-2+deb7u2 (the latter also being output from uname).

Moreover, when I look in /etc/debian_version, it tells me I'm using version 7.7.

Why am I getting so many different Debian versions listed in these places, and what is the difference between the numbers?

  • You could also have a look at /proc/config.gz this should also list a kernel version at the very beginning. Also file /boot/vmlinuz-linux can give you some information on some linux image on disk. – michas Jan 3 '15 at 13:18
  • 1
    Also mind the difference between the kernel (3.x), gcc (4.x), and debian (7.x) version. – michas Jan 3 '15 at 13:26
  • @goldilocks My bet is he will get 3.2.0-4-686-pae because the last version is kinda bogus. – kirelagin Jan 3 '15 at 13:29
  • @kirelagin Yeah, you're right. The stuff in /proc/version is coming straight from the kernel. I think the last string is actually the machine it was built on. – goldilocks Jan 3 '15 at 13:43
  • @goldilocks That was my guess too. – kirelagin Jan 3 '15 at 13:44
2

The GCC version is the version of the GNU C Compiler used to build the kernel.

According to Debian's documentation, the 3.2.0-4-686-pae is the kernel version as described upstreamversion[-abiname][-featureset]-flavour. So the upstream version is 3.2 (with .0 added in wheezy). The final 3.2.63-2+deb7u2 most likely is the package version.

I suspect the first version (3.2.0) is for ABI compatibility, and the package name reflects the actual versioning in the pacakge database.

1

The whole string gcc version 4.6.3 (Debian 4.6.3-14) refers to the version of GCC. The brackets are there to tell you that you are running GCC customized with patches by the Debian team: 4.6.3 is the GCC version and 14 is the suffix appended by Debian to tell the difference between patches they have applied.

I’m not sure what the last version refers to (but it totally looks like a kernel version). It’s a part of vendor-specific OS name, so Debian developers can actually put there whatever they like. This might be the version of kernel running on the machine that built the release or something like that.

0

That's not really a debian thing (but see comments); you'll probably find it on any linux system. The string is documented in man proc. /proc is a kernel interface, meaning when you read a file there you are actually asking the kernel for information. /proc/version returns a concatenation of three things available separately via other proc files. The strings themselves would have been built into the kernel at compile time.

The first part is from /proc/sys/kernel/ostype, probably just Linux.

The second part is from /proc/sys/kernel/osrelease and refers to the actual kernel version, in your example 3.2.0-4-686-pae.

The third part is from /proc/sys/kernel/version and includes the build number (e.g. #1) and a reference to the machine it was built on (SMP = symmetrical multiprocessing, i.e., a normal PC) and the date and time it was built.

The email address is also from the build, and the gcc version is the compiler used to do it.

  • No it is a Debian thing. The last part (version) is distro-specific, that is vendors are free to put there whatever they like. For example, here is uname -a from my laptop: Linux kirNote 3.17.7-gentookirNote #1 SMP Sat Jan 3 02:06:17 MSK 2015 x86_64 Intel(R) Core(TM)2 Duo CPU U9400 @ 1.40GHz GenuineIntel GNU/Linux. Gentoo chooses to put lots of info into this version field but notably no kernel version. – kirelagin Jan 3 '15 at 13:58
  • @kirelagin Sure, my point was /proc/version is not a Debian thing, although of course if the kernel was built by Debian, that's the info you'll get. However, if you, e.g., run a custom kernel from vanilla source on a debian system, it will not give you any debian specific information at all. – goldilocks Jan 3 '15 at 14:04
  • @kirelagin That gentoo string does contain the kernel version, 3.17.7-gentookirNote. The part after the dash is configurable at compile time, but the part before the dash is non-negotiable unless you want to hack the source first. It will be in /proc/sys/kernel/osrelease (and not version, which is a bit confusing). – goldilocks Jan 3 '15 at 14:07
0
  • 3.2.0-4-686-pae is kernel release
  • 4.6.3 is gcc version
  • #1 SMP Debian 3.2.63-2+deb7u2 is kernel version

For more info, try uname -a or uname --help

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.