Linux kernel version distribution

How do I know what linux kernel version does a distribution use?

I get 3.2.0-4-686-pae on my Debian7 and 4.4.26-gentoo on my Gentoo. But what I can’t find anywhere is what Linux kernel source versions do these distributions use. If I understand right all distributions take the kernel source code from here https://www.kernel.org. So how can I find out what Linux kernel versions from the site do use 4.4.26-gentoo or 3.2.0-4-686-pae, for example?

They start with a base version from kernel.org, but they often make tweaks. Typically you can download a source package for your particular distribution to get the version of the source from which your running kernel was built, including whatever patches the distribution maintainers applied. For example, apt-get install linux-source works on many Debian-based distributions.

@JenyaKh it is telling you the right version, for example you get 3.2.0-4-686 Ie packages.debian.org/wheezy/linux-image-3.2.0-4-amd64

@eddiem, so I only can look through their source code to try to find what version of Linux kernel they used? That’s somehow strange. I mean why nobody using a distribution is interested in what kernel sources do they use.

You know, this is really getting hard. One can not ask a question here in a way not to be minused. My question is normal. I don’t see anything wrong about it.

4 Answers 4

Try man uname and find -v for the kernel version used. 😉

So it is uname -v or uname -a if you just dont care about specifics and want to see it all. :p

$ uname -v #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) $ uname -a Linux Phobos 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux 

Check out the difference between the uname -r part and the uname -v part in uname -a (the first version number in -a)

Tank you for answer. But to be honest, it has not helped me yet. Do I understand right that the version of linux sources is 3.16.36 in your case? In general, that’s ok, as I’ve found such a version of kernel here kernel.org/pub/linux/kernel/v3.0. But on my Gentoo the «uname -a» commands just produces #1 «SMP Mon Oct 24 . 2016» — no version. And what does «#1 SMP» means I also don’t know.

Читайте также:  Linux mint change shortcuts

Yes, it means they started from a base of 3.16.36. But they applied custom patches as well, so it’s not identical to the version you would download from kernel.org, which is what I mentioned above. It really depends on why you’re asking the question as to whether the additional patches matter or not.

SMP simply means the kernel was built with multi-processor support. #1 indicates your kernel is the result of the first build from the kernel source on the machine where it was built. If they had tweaked some configuration and rebuilt, for example, it would show #2 .

Thank you for explanation, @eddiem, about SMP and the numbers. In my case uname -r shows «4.4.26-gentoo». However, what is «Linux Phobos 3.16.0-4-amd64» then? There is a packages.debian.org/jessie/linux-image-3.16.0-4-amd64 package. Maybe, your kernel sources version is 3.16.0 (not 3.16.36)? But there is no such a kernel version on linux archive site kernel.org/pub/linux/kernel/v3.0 so, probably, I’m wrong. I’m also sorry about the long delay with my answer to your comments: I just have not been signaled them appeared.

you have some way to know linux kernel version :

uname -r is the easiest way.

though there are utilities like screenfetch or neofetch that give you more information in a clear and pretty manner.

Just run screenfetch and it’ll display details. (screenfetch is usually pre-installed on most distros these days).

If it is not installed, just run sudo apt install screenfetch (on debian based distros like ubuntu) or sudo pacman -S screenfetch ( on Arch based distros.

If you are looking for original Linux kernel version that matches browse-able

https://elixir.bootlin.com/linux/vx.y.z/ 

or LINUX_KERNEL_CODE you check when developing kernel code, «uname» is not the right answer!

There are two methods (I use my Ubuntu 16.04 as example):

  1. dmesg dmesg | grep «Linux\ version» [ 0.000000] Linux version 4.4.0-210-generic (buildd@lgw01- amd64-009) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0- 6ubuntu1~16.04.12) ) #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 (Ubuntu 4.4.0-210.242-generic 4.4.262)

The original kernel version is 4.4.262! And 4.4.0-210-generic is Ubuntu’s kernel number.

Look at the newly installed file (‘uname -r’ => 4.4.0-210-generic)

/lib/modules/4.4.0-210-generic/build/include/generated/uapi/linux/version.h #define LINUX_VERSION_CODE 263423 #define KERNEL_VERSION(a,b,c) (((a)  

That version code is 0x0404FF indicating 4.4.[>=255] (where FF is for when patch exceeds 255).

-------- interesting reading below--------

It is interesting to look at the file

/lib/modules/4.4.0-210-generic/build/include/generated/utsrelease.h #define UTS_RELEASE "4.4.0-210-generic" #define UTS_UBUNTU_RELEASE_ABI 210 

Now we know where uname and /proc/version get their number.

On my Ubuntu 20.04 5.4.0-80-generic

dmesg | grep "Linux\ versin" [ 0.000000] Linux version 5.4.0-80-generic (buildd@lcy01- amd64-030) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 (Ubuntu 5.4.0-80.90-generic **5.4.124**) 
$ cat /lib/modules/5.4.0-80-generic/build/include/generated/uapi/linux/version.h #define LINUX_VERSION_CODE 328828 

where 328828 = 0x05047C, indicating 5.4.124.

Источник

Active kernel releases

There are several main categories into which kernel releases may fall:

Prepatch Prepatch or "RC" kernels are mainline kernel pre-releases that are mostly aimed at other kernel developers and Linux enthusiasts. They must be compiled from source and usually contain new features that must be tested before they can be put into a stable release. Prepatch kernels are maintained and released by Linus Torvalds. Mainline Mainline tree is maintained by Linus Torvalds. It's the tree where all new features are introduced and where all the exciting new development happens. New mainline kernels are released every 9-10 weeks. Stable After each mainline kernel is released, it is considered "stable." Any bug fixes for a stable kernel are backported from the mainline tree and applied by a designated stable kernel maintainer. There are usually only a few bugfix kernel releases until next mainline kernel becomes available -- unless it is designated a "longterm maintenance kernel." Stable kernel updates are released on as-needed basis, usually once a week. Longterm There are usually several "longterm maintenance" kernel releases provided for the purposes of backporting bugfixes for older kernel trees. Only important bugfixes are applied to such kernels and they don't usually see very frequent releases, especially for older trees.

Longterm release kernels
Version Maintainer Released Projected EOL
6.1 Greg Kroah-Hartman & Sasha Levin 2022-12-11 Dec, 2026
5.15 Greg Kroah-Hartman & Sasha Levin 2021-10-31 Oct, 2026
5.10 Greg Kroah-Hartman & Sasha Levin 2020-12-13 Dec, 2026
5.4 Greg Kroah-Hartman & Sasha Levin 2019-11-24 Dec, 2025
4.19 Greg Kroah-Hartman & Sasha Levin 2018-10-22 Dec, 2024
4.14 Greg Kroah-Hartman & Sasha Levin 2017-11-12 Jan, 2024

Distribution kernels

Many Linux distributions provide their own "longterm maintenance" kernels that may or may not be based on those maintained by kernel developers. These kernel releases are not hosted at kernel.org and kernel developers can provide no support for them.

It is easy to tell if you are running a distribution kernel. Unless you downloaded, compiled and installed your own version of kernel from kernel.org, you are running a distribution kernel. To find out the version of your kernel, run uname -r :

# uname -r 5.6.19-300.fc32.x86_64

If you see anything at all after the dash, you are running a distribution kernel. Please use the support channels offered by your distribution vendor to obtain kernel support.

Releases FAQ

Here are some questions we routinely receive about kernel release versions. See also the main "FAQ" section for some other topics.

When is the next mainline kernel version going to be released?

Linux kernel follows a simple release cadence:

  • after each mainline release, there is a 2-week "merge window" period during which new major features are introduced into the kernel
  • after the merge window closes, there is a 7-week bugfix and stabilization period with weekly "release candidate" snapshots
  • rc7 is usually the last release candidate, though occasionally there may be additional rc8+ releases if that is deemed necessary

So, to find the approximate date of the next mainline kernel release, take the date of the previous mainline release and add 9-10 weeks.

What is the next longterm release going to be?

Longterm kernels are picked based on various factors -- major new features, popular commercial distribution needs, device manufacturer demand, maintainer workload and availability, etc. You can roughly estimate when the new longterm version will become available based on how much time has elapsed since the last longterm version was chosen.

Why are some longterm versions supported longer than others?

The "projected EOL" dates are not set in stone. Each new longterm kernel usually starts with only a 2-year projected EOL that can be extended further if there is enough interest from the industry at large to help support it for a longer period of time.

Does the major version number (4.x vs 5.x) mean anything?

No. The major version number is incremented when the number after the dot starts looking "too big." There is literally no other reason.

Does the odd-even number still mean anything?

A long time ago Linux used a system where odd numbers after the first dot indicated pre-release, development kernels (e.g. 2.1, 2.3, 2.5). This scheme was abandoned after the release of kernel 2.6 and these days pre-release kernels are indicated with "-rc".

Other resources

Social

This site is operated by the Linux Kernel Organization, Inc., a 501(c)3 nonprofit corporation, with support from the following sponsors.

Источник

Оцените статью
Adblock
detector