1、导入密钥
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
2、添加库
# Centos 7 rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm # Centos 6 rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm
3、更新内核
yum --enablerepo=elrepo-kernel install kernel-ml
4、查询所有内核列表
# Centos 7 grep -oP "(?<=^menuentry \‘)[^\‘]+" /etc/grub2.cfg # Centos 6 grep -oP ‘(?<=title ).*‘ /boot/grub/grub.conf
5、修改默认启动内核
# Centos 7 grub2-set-default "CentOS Linux (4.12.4-1.el7.elrepo.x86_64) 7 (Core)" # Centos 6 sed -i ‘s/^default=.*/default=0/g‘ /boot/grub/grub.conf
6、重启
reboot
7、查看内核版本
uname -r
本文出自 “baby神” 博客,请务必保留此出处http://babyshen.blog.51cto.com/8405584/1956789
原文地址:http://babyshen.blog.51cto.com/8405584/1956789