1

Suppose I have a particular release of Ubuntu (say Ubuntu 12.04.5 LTS - Precise Pangolin). The kernel it uses is 3.13.0-32-generic x86_64. Where exactly does this version number come from? It is clearly not mainline kernel version 3.13. By looking at /usr/include/linux/version.h in 12.04.5 I found LINUX_VERSION_CODE 197199 that translates to 3.2.79, which looks more plausible, but there is also mainline v3.2.79-precise which seems to correspond to v3.2.79. Is this equivalent to 12.04.5s 3.13.0-32 kernel?

How can I find out the exact mainline kernel, a particular version of Ubuntu is based on? I'm interested in finding out how to get to this 3.13.0-32 using the exact mainline kernel commit it uses.

Kuravi H
  • 11
  • 3
  • 4
    Possible duplicate of [List of Ubuntu Versions with Corresponding Linux Kernel Version](https://askubuntu.com/questions/517136/list-of-ubuntu-versions-with-corresponding-linux-kernel-version) – N0rbert Sep 05 '18 at 19:10
  • "how to get to this 3.13.0-32 using the exact mainline kernel commit it uses" doesn't make sense, since Canonical backports patches (and may even have out-of-tree patches), so there's no way to get from the kernel commit to that number. Also: `linux/version.h` is from `linux-libc-dev`, so it may or may not have any relation to the kernel you're actually using. – muru Sep 07 '18 at 08:31

2 Answers2

2

uname -a or uname -r might be what you are looking for. See also this question and the man page for uname.

John P
  • 231
  • 1
  • 7
1

From John Ford's comment to an answer in NObert's link, the mapping you want is Ubuntu kernel to mainline map
According to that, your 3.13.0-32 Ubuntu kernel is mainline 3.13.11.4

ubfan1
  • 17,041
  • 4
  • 39
  • 47
  • so ignore `LINUX_VERSION_CODE 197199` in `/usr/include/linux/version.h`? The closest I could find in the kernel git is [v3.13.11](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tag/?h=v3.13.11) omitting the 4. – Kuravi H Sep 06 '18 at 16:00