bash#查看当前系统版本
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
#查看当前内核版本
[root@localhost ~]# uname -sr
Linux 3.10.0-514.el7.x86_64
#导入ELRepo仓库的公共密钥
[root@localhost ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
#安装ELRepo仓库的yum源
[root@localhost ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
#安装最新版本内核
[root@localhost ~]# yum --enablerepo=elrepo-kernel install kernel-ml
#查看系统上所有可用的内核
[root@localhost ~]# awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : CentOS Linux (5.18.14-1.el7.elrepo.x86_64) 7 (Core)
1 : CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)
2 : CentOS Linux (0-rescue-8ec57bd67994487a98575cb7b53ea7c9) 7 (Core)
[root@localhost ~]# grub2-set-default 0 #其中0是上面查询出来的可用内核