1、导入密钥
rpm--importhttps://www.elrepo.org/RPM-GPG-KEY-elrepo.org
2、添加库
#Centos7 rpm-Uvhhttp://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm #Centos6 rpm-Uvhhttp://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm
3、更新内核
yum--enablerepo=elrepo-kernelinstallkernel-ml
4、查询所有内核列表
#Centos7 grep-oP"(?<=^menuentry\')[^\']+"/etc/grub2.cfg #Centos6 grep-oP'(?<=title).*'/boot/grub/grub.conf
5、修改默认启动内核
#Centos7 grub2-set-default"CentOSLinux(4.12.4-1.el7.elrepo.x86_64)7(Core)" #Centos6 sed-i's/^default=.*/default=0/g'/boot/grub/grub.conf
6、重启
reboot
7、查看内核版本
uname-r原文链接:https://www.f2er.com/bash/391394.html