Centos7升级内核版本

1.加载秘钥:rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
2.安装elrepo:rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
3.加载数据:yum --disablerepo=* --enablerepo=elrepo-kernel repolist
4.查看可用包:yum --disablerepo=* --enablerepo=elrepo-kernel list kernel*
5.安装最新内核:yum --disablerepo=* --enablerepo=elrepo-kernel install -y kernel-ml.x86_64
6.查看默认内核启动顺序:awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
7.设置为0:grub2-set-default 0
8.删除旧内核(可选):

rpm -qa|grep kernel|grep 3.10
rpm -qa|grep kernel|grep 3.10|xargs yum remove -y

9.重启查看:reboot、uname -r

发表回复