安装源
[root@Pzea ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[root@Pzea ~]# rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
查看可用内核包
[root@Pzea ~]# yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
......
kernel-lt.x86_64 4.4.163-1.el7.elrepo elrepo-kernel
kernel-lt-devel.x86_64 4.4.163-1.el7.elrepo elrepo-kernel
kernel-lt-doc.noarch 4.4.163-1.el7.elrepo elrepo-kernel
kernel-lt-headers.x86_64 4.4.163-1.el7.elrepo elrepo-kernel
kernel-lt-tools.x86_64 4.4.163-1.el7.elrepo elrepo-kernel
kernel-lt-tools-libs.x86_64 4.4.163-1.el7.elrepo elrepo-kernel
kernel-lt-tools-libs-devel.x86_64 4.4.163-1.el7.elrepo elrepo-kernel
kernel-ml.x86_64 4.19.2-1.el7.elrepo elrepo-kernel
kernel-ml-devel.x86_64 4.19.2-1.el7.elrepo elrepo-kernel
kernel-ml-doc.noarch 4.19.2-1.el7.elrepo elrepo-kernel
kernel-ml-headers.x86_64 4.19.2-1.el7.elrepo elrepo-kernel
kernel-ml-tools.x86_64 4.19.2-1.el7.elrepo elrepo-kernel
kernel-ml-tools-libs.x86_64 4.19.2-1.el7.elrepo elrepo-kernel
kernel-ml-tools-libs-devel.x86_64 4.19.2-1.el7.elrepo elrepo-kernel
perf.x86_64 4.19.2-1.el7.elrepo elrepo-kernel
python-perf.x86_64 4.19.2-1.el7.elrepo elrepo-kernel
kernel-ml.x86_64 4.19.2-1.el7.elrepo elrepo-kernel 是ml stands for mainline stable 主线稳定版本。就安装它了。
[root@Pzea ~]# yum --enablerepo=elrepo-kernel install kernel-ml
修改grub,使用第一个内核作为默认启动。
[root@Pzea ~]# sed -i "s/GRUB_DEFAULT=saved/GRUB_DEFAULT=0/g" /etc/default/grub
重新生成grub配置
[root@Pzea ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
重启系统,验证内核版本:
[root@Pzea ~]# uname -sr
Linux 4.19.2-1.el7.elrepo.x86_64
[root@Pzea ~]#
rpm –import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
yum –enablerepo=elrepo-kernel install kernel-ml kernel-ml-devel -y
egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \’
grub2-set-default 0
reboot
要不要更简单的更新方法