Centos 7 安装kernel 5.1.x版本

昨天晚上红帽发布了一个新的内核漏洞,漏洞详情如下: 

https://access.redhat.com/security/vulnerabilities/tcpsack

影响范围极大,必须立刻修复,对于Centos7而言内核版本在3.10.0-957.21.2及以下的统统中招,但是到现在也没有官方推送的新版本3.10.0-957.21.3内核可用,时不我与时不我待,直接整5.11先用着,等待修复了再切换回去。

现在Centos 7 默认的最新内核版本号是3.10.0-957.21.2.el7.x86_64,这对于企业来说已经够用了,但是对于个人用户或者要体验新东西的极客们而言,版本实在是太低了,所以这里就来记录一下如何利用yum安装法把服务器内核升级为高版本。

1、卸载多余的内核,只保留3.10.0-957.21.2.el7.x86_64

# rpm -qa | grep kernel # 查看现在安装的内核
然后用 yum remove 将多余的kernel-devel kernel-headers kernel-tools-libs-devel kernel-tools kernel-tools-libs等全部卸载

2、安装keys
# rpm –import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

3、安装yum源站
# yum install https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

4、安装kernel-ml
# yum –enablerepo=elrepo-kernel install kernel-ml* perf python-perf -y
将会安装下列rpm包
kernel-ml
kernel-ml-headers
kernel-ml-devel
kernel-ml-doc
kernel-ml-tools
kernel-ml-tools-libs
kernel-ml-tools-libs-devel
perf
python-perf

5、切换内核
# grub2-set-default 0

6、重启服务器
# init 6

7、查看内核版本
# uname -r
5.1.11-1.el7.elrepo.x86_64

这样,服务器就完成了升级到最新的内核

如果以后要更新内核,执行下面的命令即可:

# yum –enablerepo=elrepo-kernel update kernel-ml* perf python-perf

6 评论

  1. Please let me know if you’re looking for a article author for your site.
    You have some really good articles and I think I would be a good asset.
    If you ever want to take some of the load off, I’d love to write
    some content for your blog in exchange for a link back to mine.

    Please shoot me an email if interested. Kudos!

  2. I really like your blog.. very nice colors & theme.
    Did you create this website yourself or did you hire someone
    to do it for you? Plz respond as I’m looking to create my own blog and would like to find out where u got this from.
    many thanks

  3. Definitely imagine that which you said. Your favourite justification appeared to be at
    the web the simplest thing to take into accout of. I say to you, I certainly get annoyed even as folks
    consider concerns that they just do not recognise about. You
    managed to hit the nail upon the top and also outlined out the entire thing with no need
    side-effects , people can take a signal. Will probably be back to get more.

    Thank you

留下评论

error: Content is protected !!