Merge pull request #16997 from chen-ni/master

翻译完成:20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md
This commit is contained in:
Xingyu.Wang 2020-01-11 08:45:03 +08:00 committed by GitHub
commit 0065181afc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 120 additions and 120 deletions

View File

@ -1,120 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (chen-ni)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Explained! Why Your Distribution Still Using an Outdated Linux Kernel?)
[#]: via: (https://itsfoss.com/why-distros-use-old-kernel/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
Explained! Why Your Distribution Still Using an Outdated Linux Kernel?
======
[Check your Linux kernel version][1]. Chances are that youll find that the kernel version your system is using has already reached end of life (EOL) as listed on Linux Kernel website.
End of life means a software wont get bug fixes and support anymore.
That poses some valid questions. Why is my Linux distribution using a kernel that has reached end of life? Is this not a security risk? Is my system safe?
Let me explain all these questions in this article.
Summary
The upstream kernel support and the your distributions kernel support are two different things.
For example, Linux kernel 4.15 might have reached end of life (as per the official Linux kernel website) but Ubuntu 18.04 LTS release will use it and maintain it till April 2023 by backporting security patches and bug fixes.
### Checking Linux kernel version and finding its end of life status
Lets first check the Linux kernel version on your system:
```
uname -r
```
I am using Ubuntu 18.04 here and it shows the Linux kernel version like this:
```
[email protected]:~$ uname -r
5.0.0-37-generic
```
Now, you may go to the official Linux kernel website and see what Linux kernels are still being supported. Its displayed on the homepage itself.
[Linux Kernel Official Website][2]
You should see a status like this:
![Linux Kernel Status][3]
If you dont see a kernel version listed on the homepage of kernel website, it means that specific version has reached end of life.
As you can see, kernel 5.0 is not listed here. It indicates that this kernel version is not being supported anymore. Actually, it [reached end of life in June 2019][4].
The life cycle of a Linux kernel doesnt follow a set pattern, unfortunately. Its NOT like a regular kernel stable release will be supported for X months and a long term support(LTS) kernel will be supported for Y years.
Based on the demand and requirements, there could be several LTS kernel versions with different EOL. You can find them along with their projected EOL on [this page][5].
Now comes the big question. Why is Ubuntu providing kernel 5.0 if the Linux kernel website shows that it has reached its end of life?
### Your distribution uses an EOL Linux kernel but thats Okay!
![][6]
Have you ever wondered why Ubuntu/Debian/Fedora etc are called Linux distributions? Its because they distribute the Linux kernel.
They have their own modification of the Linux kernel, they add the GUI elements (desktop environment, display server etc) and software and they make it available to their users.
In the typical workflow, a Linux distribution will choose a kernel to provide to its users. And then it will hold on to this kernel for months or years even after the kernel has reached end of life.
How is it safe then? Its because the _**distribution maintains the kernel by backporting all the important fixes to its kernel**_.
In other words, your Linux distribution makes sure that your Linux kernel is patched well and has all the bug fixes and important new features backported to it. There will be thousands of changes on top of the old outdated Linux kernel.
When the Linux kernel website says that a certain kernel version has reached EOL, it means that the core Linux kernel maintainers are not going to update/patch that kernel version anymore.
But at the same time, the developers at Debian/Ubuntu or other distributions work to keep the same old version alive by bringing the relevant changes from the newer kernel versions (being maintained by the core kernel team) to your distributions old kernel.
Bottom line is that even if it seems like your distribution is using an outdated Linux kernel, it is actually being well maintained and not really outdated.
### Should you use the latest stable kernel version?
![][7]
A new stable Linux kernel version is released every 2-3 months. And this makes many users wonder who they can get their hands on that new shiny thing.
To be frank, you should not do that unless you have a pretty good reason for it. Your distribution doesnt provide it to you. You cannot just use _sudo apt give-me-the-latest-stable-kernel_.
Now, manually [installing the mainline Linux kernel version][8] could be a challenge in itself. Even if you manage to install it, it is now up to you to make sure that this kernel is updated every time there is a bug fix. And when this new kernel reaches end of life, it becomes your responsibility to upgrade to the newer kernel version. It wont be handled with apt upgrade like regular [Ubuntu updates][9].
You should also keep in mind that your distribution also has drivers and patches which you may not be able to use if you switch to the mainline kernel.
As [Greg Kroah-Hartman][10] puts it, “_**the best kernel you can use is one that someone else supports**_“. And who can be better at this job then your Linux distribution!
I hope you have a better understanding on this topic and you wont panic the next time you find out that the kernel version your system is using has reached end of life.
I welcome your questions and suggestions. Please feel free to use the comment section.
--------------------------------------------------------------------------------
via: https://itsfoss.com/why-distros-use-old-kernel/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[chen-ni](https://github.com/chen-ni)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/
[2]: https://www.kernel.org/
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/linux-kernel-status.jpg?ssl=1
[4]: http://lkml.iu.edu/hypermail/linux/kernel/1906.0/02354.html
[5]: https://www.kernel.org/category/releases.html
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/Keep_Calm_and_Trust_Your_Distribution.png?ssl=1
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/using_latest_kernel.png?ssl=1
[8]: https://wiki.ubuntu.com/Kernel/MainlineBuilds
[9]: https://itsfoss.com/update-ubuntu/
[10]: https://en.wikipedia.org/wiki/Greg_Kroah-Hartman

View File

@ -0,0 +1,120 @@
[#]: collector: (lujun9972)
[#]: translator: (chen-ni)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Explained! Why Your Distribution Still Using an Outdated Linux Kernel?)
[#]: via: (https://itsfoss.com/why-distros-use-old-kernel/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
为什么你的发行版仍然在使用“过时的”Linux 内核?
======
[检查一下你的系统所使用的 Linux 内核版本][1],你十有八九会发现,按照 Linux 内核官网提供的信息,该内核版本已经达到使用寿命终期了。
一个软件一旦达到了使用寿命终期,那么就意味着它再也不会得到 bug 修复和维护了。
这自然会引发一连串问题:为什么我的 Linux 发行版会使用一个已经达到使用寿命终期的内核呢?这样做有没有安全风险?我的系统还安全吗?
下面将逐一解答这些问题。
总结
上游内核维护与你的发行版的内核维护是两个不同的概念。
例如,根据 Linux 内核官网Linux 内核 4.15 版本可能已经达到使用寿命终期了,但是在 2023 年 4 月之前Ubuntu 18.04 长期维护版本将会继续使用这个版本,并通过向后移植安全补丁和修复 bug 来提供维护。
### 检查 Linux 内核版本,以及是否达到使用寿命终期
首先,查看你的系统所使用的 Linux 内核版本:
```
uname -r
```
我使用的是 Ubuntu 18.04,输出的 Linux 内核版本如下:
```
[email protected]:~$ uname -r
5.0.0-37-generic
```
接下来,可以到 Linux 内核官网上看看哪些 Linux 内核版本仍然在维护状态。在网站主页上就可以看到相关信息。
[Linux 内核官网][2]
你看到的内核版本状态应该类似于下图:
![Linux 内核状态][3]
如果你的内核版本没有列在内核官网主页上,就说明该版本已经达到了使用寿命终期。
可以看到5.0 内核版本并不在列,这说明该内核版本已经不再得到维护。事实上,该版本在 [2019 年 6 月就已经达到使用寿命终期了][4]。
不幸的是Linux 内核的生命周期没有任何规律可循。不是说常规的内核稳定发布版可以得到 X 月的维护、长期维护版本LTS可以得到 Y 年的维护。没有这回事。
根据实际需求,可能会存在内核的多个 LTS 版本,其使用寿命终期各不相同。在[这个页面][5]上可以查到这些 LTS 版本的相关信息,包括推定的使用寿命终期。
那么问题来了:既然 Linux 内核官网上明确表示 5.0 版本的内核已经达到了使用寿命终期Ubuntu 为什么还在提供这个内核版本呢?
### 你的发行版使用的 Linux 内核已经达到了使用寿命终期,但是没关系!
![][6]
你是否想过,为什么 Ubuntu/Debian/Fedora 等发行版被称为 Linux “发行版”?这是因为,它们“发行” Linux 内核。
这些发行版会对 Linux 内核进行不同的修改,并添加各种 GUI 元素(包括桌面环境,显示服务器等)以及软件,然后再呈现给用户。
按照通常的工作流Linux 发行版会选择一个内核,提供给其用户,然后在接下来的几个月、几年中,甚至是达到内核的使用寿命终期之后,仍然会继续使用该内核。
这样能够保障安全吗?其实是可以的,因为 _**发行版会通过向后移植全部的重要修补来维护内核**_
换句话说,你的 Linux 发行版会确保 Linux 内核没有漏洞和 bug并且已经通过向后移植获得了重要的新特性。在“过时的旧版本 Linux 内核”上,其实有着数以千计的改动。
如果 Linux 内核网站上说某个内核版本已经达到了使用寿命终期,那么就意味着 Linux 内核的核心维护团队不会再对该内核版本进行升级和打补丁了。
但与此同时Debian/Ubuntu 或者其他发行版的开发者们会继续工作,通过从(由内核核心团队维护的)更新的内核版本中迁移相关的修改,维持这个老版本的生命力。
重点在于,即使你的发行版看上去是在使用一个已经过时的 Linux 内核,其实该内核也得到了良好的维护,并非是真的过时了。
### 你是否应该使用最新的稳定内核版本?
![][7]
新的 Linux 内核稳定版本每隔 2 到 3 个月发布一次,有不少用户跃跃欲试。
实话说除非有十分充分的理由否则不应该使用最新版本的稳定内核。你使用的发行版并不会提供这个选项你也不能指望通过在键盘上敲出“_sudo apt give-me-the-latest-stable-kernel_”解决问题。
此外,手动[安装主流 Linux 内核版本][8]本身就是一个挑战。即使安装成功,之后每次发布 bug 修复的时候,负责更新内核的就会是你了。此外,当新内核达到使用寿命终期之后,你就有责任将它升级到更新的内核版本了。和常规的[Ubuntu 更新][9]不同,内核升级无法通过 apt upgrade 完成。
同样需要记住的是,切换到主流内核之后,可能就无法使用你的发行版提供的一些驱动程序和补丁了。
正如 [Greg Kroah-Hartman][10]所言“_**你能使用的最好的内核,就是别人在维护的内核。**_”除了你的 Linux 发行版之外,又有谁更胜任这份工作呢!
希望你对这个主题已经有了更好的理解。下回发现你的系统正在使用的内核版本已经达到使用寿命终期的时候,希望你不会感到惊慌失措。
欢迎在下面的评论区中留下你的疑问或建议。
--------------------------------------------------------------------------------
via: https://itsfoss.com/why-distros-use-old-kernel/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[chen-ni](https://github.com/chen-ni)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/
[2]: https://www.kernel.org/
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/linux-kernel-status.jpg?ssl=1
[4]: http://lkml.iu.edu/hypermail/linux/kernel/1906.0/02354.html
[5]: https://www.kernel.org/category/releases.html
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/Keep_Calm_and_Trust_Your_Distribution.png?ssl=1
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/using_latest_kernel.png?ssl=1
[8]: https://wiki.ubuntu.com/Kernel/MainlineBuilds
[9]: https://itsfoss.com/update-ubuntu/
[10]: https://en.wikipedia.org/wiki/Greg_Kroah-Hartman