第一种针对当前内核版本的小版本升级可以采用如下方法:

[root@localhost ~]# uname -r
3.10.-.el7
[root@localhost ~]# yum list kernel
[root@localhost ~]# yum update -y kernel
[root@localhost ~]# uname -r
3.10.-862.14..el7
[root@localhost ~]# grub2-editenv list
saved_entry=CentOS Linux (3.10.-862.14..el7.x86_64) (Core) #升级完成小版本之后,系统会将升级后的小版本内核设置为默认启动内核
#执行完上述命令之后,使用uname -r对比可以看出已经升级了小版本
[root@localhost ~]# yum list kernel
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.sjtu.edu.cn
* elrepo: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.shu.edu.cn
* updates: ftp.sjtu.edu.cn
elrepo | 2.9 kB ::
elrepo/primary_db | kB ::
Installed Packages
kernel.x86_64 3.10.-.el7 @anaconda
kernel.x86_64 3.10.-862.14..el7 @updates

第二种升级大版本

首先了解下这个网站
https://www.elrepo.org
.导入公钥
[root@localhost ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
.安装ELRepo
[root@localhost ~]# rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
.禁用其他的repo源,启用ELRepo源
[root@localhost ~]# yum --disablerepo=\* --enablerepo=elrepo-kernel repolist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* elrepo-kernel: mirrors.tuna.tsinghua.edu.cn
repo id repo name status
elrepo-kernel ELRepo.org Community Enterprise Linux Kernel Repository - el7
repolist:
.查看ELRepo可用的软件包
[root@localhost ~]# yum --disablerepo=\* --enablerepo=elrepo-kernel list kernel*
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* elrepo-kernel: mirrors.tuna.tsinghua.edu.cn
Installed Packages
kernel.x86_64 3.10.-.el7 @anaconda
kernel.x86_64 3.10.-862.14..el7 @updates
kernel-ml.x86_64 4.18.-.el7.elrepo @elrepo-kernel
kernel-tools.x86_64 3.10.-.el7 @anaconda
kernel-tools-libs.x86_64 3.10.-.el7 @anaconda
Available Packages
kernel-lt.x86_64 4.4.-.el7.elrepo elrepo-kernel
kernel-lt-devel.x86_64 4.4.-.el7.elrepo elrepo-kernel
kernel-lt-doc.noarch 4.4.-.el7.elrepo elrepo-kernel
kernel-lt-headers.x86_64 4.4.-.el7.elrepo elrepo-kernel
kernel-lt-tools.x86_64 4.4.-.el7.elrepo elrepo-kernel
kernel-lt-tools-libs.x86_64 4.4.-.el7.elrepo elrepo-kernel
kernel-lt-tools-libs-devel.x86_64 4.4.-.el7.elrepo elrepo-kernel
kernel-ml-devel.x86_64 4.18.-.el7.elrepo elrepo-kernel
kernel-ml-doc.noarch 4.18.-.el7.elrepo elrepo-kernel
kernel-ml-headers.x86_64 4.18.-.el7.elrepo elrepo-kernel
kernel-ml-tools.x86_64 4.18.-.el7.elrepo elrepo-kernel
kernel-ml-tools-libs.x86_64 4.18.-.el7.elrepo elrepo-kernel
kernel-ml-tools-libs-devel.x86_64 4.18.-.el7.elrepo elrepo-kernel
.安装最新的kernel版本
[root@localhost ~]# yum --disablerepo=\* --enablerepo=elrepo-kernel install kernel-ml.x86_64
.此时还不能直接安装新版本内核的工具包,需要先卸载旧版本内核的工具包
查看老版本
[root@localhost ~]# yum list installed | grep kernel-tools*
kernel-tools.x86_64 3.10.-.el7 @anaconda
kernel-tools-libs.x86_64 3.10.-.el7 @anaconda
卸载老版本
[root@localhost ~]# yum remove -y kernel-tools*
.安装最新版本的内核工具包
[root@localhost ~]# yum --disablerepo=\* --enablerepo=elrepo-kernel install -y kernel-ml-tools.x86_64
到此,内核大版本升级虽然已完成,但是系统当前版本依然是:
[root@localhost ~]# uname -r
3.10.-862.14..el7.x86_64

!注意:重启开机界面,默认的内核版本是之前升级的小版本,并不是大版本号

可以手动选择升级后的大版本号,也可以进入系统修改默认启动内核:

[root@localhost ~]# cat /boot/grub2/grub.cfg | grep menuentry
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
menuentry_id_option=""
export menuentry_id_option
menuentry 'CentOS Linux (4.18.13-1.el7.elrepo.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-862.el7.x86_64-advanced-665da203-11f4-4366-92ce-5021231ee154' {
menuentry 'CentOS Linux (3.10.0-862.14.4.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-862.el7.x86_64-advanced-665da203-11f4-4366-92ce-5021231ee154' {
menuentry 'CentOS Linux (3.10.0-862.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-862.el7.x86_64-advanced-665da203-11f4-4366-92ce-5021231ee154' {
menuentry 'CentOS Linux (0-rescue-23361e5303e64609b437b298ecde192e) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-23361e5303e64609b437b298ecde192e-advanced-665da203-11f4-4366-92ce-5021231ee154' {
[root@localhost ~]# grub2-set-default 'CentOS Linux (4.18.13-1.el7.elrepo.x86_64) 7 (Core)'
[root@localhost ~]# grub2-editenv list
saved_entry=CentOS Linux (4.18.-.el7.elrepo.x86_64) (Core)
重启系统,查看
[root@localhost ~]# uname -r
4.18.-.el7.elrepo.x86_64
如果不需要旧版本的内核软件包,可以使用yum卸载掉

第三种升级内核的方式:

了解下这个网站
https://www.kernel.org/
可以在这里下载最新版本的内核tar包,然后确保系统装了gcc,cmake等工具,然后跟其他软件的tar安装方式一样,解压,编译,安装即可。

附:

kernel-ml 中的ml是英文【mainline stable】的缩写,elrepo-kernel中罗列出来的是最新的稳定主线版本。

kernel-lt 中的lt是英文【long term support】的缩写,elrepo-kernel中罗列出来的长期支持版本。
参考原文:https://blog.csdn.net/breeze915/article/details/79243673

 

CentOS 7.x升级内核的更多相关文章

  1. centos 6.5 升级内核 linux 3.12.17 (笔记 实测)

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G) 系统版本:Linux centos 2.6.32-431.el6.x86_64(Centos-6.5-x86_64-mi ...

  2. centos 6.5 升级内核 linux 3.12.17

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G) 系统版本:Linux centos 2.6.32-431.el6.x86_64(Centos-6.5-x86_64-mi ...

  3. CentOS 6.5 升级内核

    Docker需要3.10以上内核支持,Centos6.5 默认内核为2.6.所以手动编译安装3.10内核. 查看当前系统内核版本 [root@gu ~]# uname -r2.6.32-431.el6 ...

  4. CentOS 6.5 升级内核到 3.10.28

    本文适用于CentOS 6.4, CentOS 6.5,亲测可行,估计也适用于其他Linux发行版. 1. 准备工作 1.1 下载源码包 Linux内核版本有两种:稳定版和开发版 ,Linux内核版本 ...

  5. 在centos 7下升级内核

      前言 今天读了一篇老外的文章,讲的是如何在linux环境下升级内核.比较暴力,比较简单,故做个记录.   文章中,作者先列出一个常识:linux是内核名,不是系统名.我们平时说的"lin ...

  6. CentOS 6.5 升级内核 kernel

    本文适用于CentOS 6.5, CentOS 6.6,亲测可行,估计也适用于其他Linux发行版. 1. 准备工作 1.1 下载源码包 Linux内核版本有两种:稳定版和开发版 ,Linux内核版本 ...

  7. 【kernel】Centos 云上升级内核失败 如何处理【笔记记录转】

    Centos7选定默认启动的内核版本 vim /etc/grub2.cfg   修改timeout =5   修改成30天 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附 ...

  8. centos 6.5升级内核到3.1

    1.查看本机内核版本 [root@localhost ~]# uname -r 2.6.32-358.el6.x86_64 2.安装含有内核软件的源 步骤一:导入证书 [root@localhost ...

  9. CentOS 6 - 升级内核

    有的时候,需要升级Linux内核,今天我就是在CentOS 6中升级内核,在没有升级内核之前,我的CentOS 6只有2.6.32这一个内核,也是默认启动的内核.下面就开始一步步操作升级内核了! 一, ...

随机推荐

  1. android读取apk中已经存在的数据库信息

    在android数据库编程方面,大家有没有遇到过,我要从指定位置的已经存在的数据库来进行操作的问题.之前我尝试了很多方法都没有成功,后来找到了解决的方法.   下面说明下这段代码的意思,第一步先判断在 ...

  2. Java深度理解——Java字节代码的操纵

    导读:Java作为业界应用最为广泛的语言之一,深得众多软件厂商和开发者的推崇,更是被包括Oracle在内的众多JCP成员积极地推动发展.但是对于 Java语言的深度理解和运用,毕竟是很少会有人涉及的话 ...

  3. bind (ERROR 502): bind(0.0.0.0:9501) failed. Error: Address already in use [98] (端口被占用)

    运行 swoole_server 服务报错显示端口被占用 解决思路: 1.用命令查看该端口 看是否存在 netstat  -anp  |  grep 9501 2.如果存在 就用 kill对应端口号 ...

  4. 简单三步快速学会使用Mybatis-Generator自动生成entity实体、dao接口以及mapper映射文件(postgre使用实例)

    前言: mybatis-generator是根据配置文件中我们配置的数据库连接参数自动连接到数据库并根据对应的数据库表自动的生成与之对应mapper映射(比如增删改查,选择性增删改查等等简单语句)文件 ...

  5. mtk6737t摄像头配置文件的编译

    修改摄像头的配置文件后,一直没有编译生效,要make一遍才生效,最终查出编译配置的方法摄像头配置文件路径 vendor/mediatek/proprietary/custom/mt6735/hal/D ...

  6. JavaScript-Tool:jquery.vaidate.js

    ylbtech-JavaScript-Tool:jquery.vaidate.js 1.返回顶部 1. 2. 3. 2.返回顶部   3.返回顶部   4.返回顶部   5.返回顶部 0. https ...

  7. hibernate 学习 一 基本概念

    1: Hibernate对JDBC进行封装,以面向对象的方式对关系型数据库进行操作. 2:  Hibernate的配置文件: hibernate.properties  或者  hibernate.c ...

  8. 【Linux学习】Linux文件系统4—Linux文件硬链接与软连接

    Linux文件系统4-Linux文件硬链接与软连接 inode:索引节点 (连接文件)link 一.文件硬链接 1.Linux文件系统中,inode只相同的文件是硬链接文件 2.不同文件名,inode ...

  9. jquery的on()绑定无效的方式

    on前面的元素也必须在页面加载的时候就存在于dom里面.动态的元素或者样式等,可以放在on的第二个参数里面 jQuery on()方法是官方推荐的绑定事件的一个方法.使用 on() 方法可以给将来动态 ...

  10. HDU5119【dp背包求方案数】

    题意: 有n个数,问有多少方案满足取几个数的异或值>=m; 思路: 背包思想,每次就是取或不取,然后输出>=m的方案就好了. #include <bits/stdc++.h> ...