1、安装内核升级镜像源
yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
2、Yum安装内核(长期维护版)
yum --disablerepo=\* --enablerepo=elrepo-kernel install kernel-lt.x86_64
3、查看当前默认启动内核
grub2-editenv list
4、查看系统已安装的所有内核
cat /boot/grub2/grub.cfg | grep menuentry #也可通过如下命令查看并设置: awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg #默认启动的顺序是从0开始,新内核是从头开始插入 grub2-set-default 0
5、修改已安装的最新内核作为默认启动内核
grub2-set-default 'CentOS Linux (5.4.223-1.el7.elrepo.x86_64) 7 (Core)'
6、重启并查看内核
grub2-editenv list uname -a
参考:
https://wiki.centos.org/HowTos/Grub2 https://abelsu7.top/2019/02/18/centos7-grub2/ https://github.com/easzlab/kubeasz/blob/master/docs/guide/kernel_upgrade.md http://www.mydlq.club/article/79/