您的当前位置:首页 --> CentOS入门
CentOS7升级内核到最新版本
浏览次数:989 关键词 ( 最新版本  内核  )

查看当前系统的内核版本

# uname -r 
1、导入key
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
2、安装elrepo的yum源
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

如果安装过程中出现yum提示的错误

Another app is currently holding the yum lock

执行如下语句

# rm -f /var/run/yum.pid

就可以继续执行更新了。

3、安装内核

在yum的ELRepo源中,有最新内核版本,目前4.6dev

yum --enablerepo=elrepo-kernel install  kernel-ml-devel kernel-ml -y

更新后查看内核版本  [root@ip-10-10-17-4 tmp]# uname -r  3.10.0-123.el7.x86_64

重要:目前内核还是默认的版本,如果在这一步完成后你就直接reboot了,重启后使用的内核版本还是默认的3.10,不会使用新的内核,想修改启动的顺序,需要进行下一步

4.查看默认启动顺序
CentOS Linux (4.6.0-1.el7.elrepo.x86_64) 7 (Core)
CentOS Linux (4.6.0-1.el7.elrepo.x86_64) 7 (Core) with debugging
CentOS Linux 7 (Core), with Linux 3.10.0-229.el7.x86_64
CentOS Linux 7 (Core), with Linux 0-rescue-c25a1eaf12bd4a3f9235a3a124d0d4c8

默认启动的顺序是从0开始,但我们新内核是从头插入(目前位置在0,而3.10的是在1),所以需要选择0,如果想生效最新的内核,需要

grub2-set-default 0
5.查看内核版本

然后reboot重启,使用新的内核,下面是重启后使用的内核版本

# uname -r 

为最新的linux内核。

下一条 centos系统中网络配置相关
上一条 Centos 7一个网卡配置多个IP的方法

数千企业与站长的选择,7*24小时稳定运行

 了解更多套餐详细