安装ELRepo 仓库

yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm

查看可用的系统内核包

yum --disablerepo="*" --enablerepo="elrepo-kernel" list available

已加载插件:fastestmirror, priorities Loading mirror speeds from cached
hostfile * elrepo-kernel: hkg.mirror.rackspace.com elrepo-kernel
| 3.0 kB 00:00:00 elrepo-kernel/primary_db
| 2.0 MB 00:00:00 可安装的软件包 kernel-lt.x86_64
5.4.92-1.el7.elrepo elrepo-kernel kernel-lt-devel.x86_64
5.4.92-1.el7.elrepo elrepo-kernel kernel-lt-doc.noarch
5.4.92-1.el7.elrepo elrepo-kernel kernel-lt-headers.x86_64
5.4.92-1.el7.elrepo elrepo-kernel kernel-lt-tools.x86_64
5.4.92-1.el7.elrepo elrepo-kernel kernel-lt-tools-libs.x86_64
5.4.92-1.el7.elrepo elrepo-kernel kernel-lt-tools-libs-devel.x86_64
5.4.92-1.el7.elrepo elrepo-kernel kernel-ml.x86_64
5.10.10-1.el7.elrepo elrepo-kernel kernel-ml-devel.x86_64
5.10.10-1.el7.elrepo elrepo-kernel kernel-ml-doc.noarch
5.10.10-1.el7.elrepo elrepo-kernel kernel-ml-headers.x86_64
5.10.10-1.el7.elrepo elrepo-kernel kernel-ml-tools.x86_64
5.10.10-1.el7.elrepo elrepo-kernel kernel-ml-tools-libs.x86_64
5.10.10-1.el7.elrepo elrepo-kernel kernel-ml-tools-libs-devel.x86_64
5.10.10-1.el7.elrepo elrepo-kernel perf.x86_64 5.10.10-1.el7.elrepo elrepo-kernel python-perf.x86_64
5.10.10-1.el7.elrepo elrepo-kernel

安装lt版本内核,也可以选择ml最新版

yum --enablerepo=elrepo-kernel install kernel-lt

查看系统上的所有可以内核

awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg

设置 grub2,并生成grub配置文件

grub2-set-default 0
grub2-mkconfig -o /boot/grub2/grub.cfg

Generating grub configuration file ... Found linux image:
/boot/vmlinuz-5.4.92-1.el7.elrepo.x86_64 Found initrd image:
/boot/initramfs-5.4.92-1.el7.elrepo.x86_64.img Found linux image:
/boot/vmlinuz-3.10.0-1160.11.1.el7.x86_64 Found initrd image:
/boot/initramfs-3.10.0-1160.11.1.el7.x86_64.img Found linux image:
/boot/vmlinuz-3.10.0-1160.el7.x86_64 Found initrd image:
/boot/initramfs-3.10.0-1160.el7.x86_64.img Found linux image:
/boot/vmlinuz-0-rescue-8610d2b65b804762b5a6575cd6c255a4 Found initrd
image: /boot/initramfs-0-rescue-8610d2b65b804762b5a6575cd6c255a4.img
done

重启并查看当前内核

reboot
uname -r

标签: Linux

添加新评论