centos7升级内核
注意事项:因为www.elrepo.org属于美国网站,WiFi环境下访问失败的话,可以尝试下手机热点。
实现从3.10.0-1160.el7.x86_64 ----> 升级到5.4.269-1.el7.elrepo.x86_64
1.查看目前内核版本
[root@lnmpb ~]# uname -r
3.10.0-1160.el7.x86_64
2.导入仓库源
[root@lnmpb ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[root@lnmpb ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
获取http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
获取http://elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm
准备中... ################################# [100%]
正在升级/安装...
1:elrepo-release-7.0-4.el7.elrepo ################################# [100%]
3.查看可安装的软件包
[root@lnmpb ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
获取http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
获取http://elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm
准备中... ################################# [100%]
正在升级/安装...
1:elrepo-release-7.0-4.el7.elrepo ################################# [100%]
[root@lnmpb ~]# yum --enablerepo="elrepo-kernel" list --showduplicates | sort -r | grep kernel-ml.x86_64
Could not retrieve mirrorlist http://mirrors.elrepo.org/mirrors-elrepo.el7 error was
14: curl#7 - "Failed connect to mirrors.elrepo.org:80; 拒绝连接"
Could not retrieve mirrorlist http://mirrors.elrepo.org/mirrors-elrepo-kernel.el7 error was
14: curl#7 - "Failed connect to mirrors.elrepo.org:80; 拒绝连接"
kernel-ml.x86_64 6.7.6-1.el7.elrepo elrepo-kernel
kernel-ml.x86_64 6.7.5-1.el7.elrepo elrepo-kernel
kernel-ml.x86_64 6.7.4-1.el7.elrepo elrepo-kernel
4.安装版本
[root@lnmpb ~]# yum --enablerepo=elrepo-kernel install kernel-lt-devel kernel-lt -y
5.查看现有内核启动顺序
[root@lnmpb ~]# awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
CentOS Linux (5.4.269-1.el7.elrepo.x86_64) 7 (Core)
CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)
CentOS Linux (0-rescue-7da4bdac78f54270ad3cccda6d62b726) 7 (Core)
6.修改默认启动项
[root@lnmpb ~]# grub2-set-default 0
7.重启
[root@lnmpb ~]# reboot
8.查看内核版本
[root@lnmpb ~]# uname -r
5.4.269-1.el7.elrepo.x86_64