快速升級內核
uname -r
yum -y update
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
rpm -Uvh https://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm #centos 6.x
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
yum --enablerepo=elrepo-kernel install kernel-ml
awk -F[\‘] ‘$1=="menuentry " {print i++ " : " $2}‘ /etc/grub2.cfg
grub2-set-default 0
sed -i ‘s#GRUB_DEFAULT=saved#GRUB_DEFAULT=0#g‘ /etc/default/grub #centos 6.x系列只需要做這一步,grub2*相關指令不需要執行
grub2-mkconfig -o /boot/grub2/grub.cfg
reboot
rpm -qa | grep kernel
yum remove kernel-tools-libs-3.10.0-514.26.2.el7.x86_64 kernel-3.10.0-327.el7.x86_64 kernel-tools-3.10.0-514.26.2.el7.x86_64 kernel-headers-3.10.0-514.26.2.el7.x86_64 kernel-3.10.0-514.26.2.el7.x86_64
yum install yum-utils && package-cleanup --oldkernels
快速升級內核