CentOS升级内核
先下载yum文件
$ wget https://elrepo.org/linux/kernel/el7/x86_64/RPMS/kernel-ml-5.19.0-1.el7.elrepo.x86_64.rpm
$ wget https://elrepo.org/linux/kernel/el7/x86_64/RPMS/kernel-ml-devel-5.19.0-1.el7.elrepo.x86_64.rpm
然后用yum安装
$ yum install -y kernel-ml-5.19.0-1.el7.elrepo.x86_64.rpm kernel-ml-devel-5.19.0-1.el7.elrepo.x86_64.rpm
修改默认启动内核
$ grub2-set-default "CentOS Linux (5.19.0-1.el7.elrepo.x86_64) 7 (Core)" && grub2-editenv list && reboot
这里的"CentOS Linux (5.19.0-1.el7.elrepo.x86_64) 7 (Core)"的来源
查看grub2.cfg文件中的菜单选项
$ cat /etc/grub2.cfg | grep ^menuentry
menuentry 'CentOS Linux (5.19.0-1.el7.elrepo.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1160.el7.x86_64-advanced-f91013a2-1343-4db4-aa1b-9b4fb2dd33e1' {
menuentry 'CentOS Linux (3.10.0-1160.62.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1160.el7.x86_64-advanced-f91013a2-1343-4db4-aa1b-9b4fb2dd33e1' {
menuentry 'CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1160.el7.x86_64-advanced-f91013a2-1343-4db4-aa1b-9b4fb2dd33e1' {
menuentry 'CentOS Linux (0-rescue-3fb22f959f1345f2811ee97512699276) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-3fb22f959f1345f2811ee97512699276-advanced-f91013a2-1343-4db4-aa1b-9b4fb2dd33e1' {
重启后查看
$ uname -a
Linux CentOS7906 5.19.0-1.el7.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jul 31 19:04:17 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux
本文来自博客园,作者:厚礼蝎,转载请注明原文链接:https://www.cnblogs.com/guangdelw/p/17138876.html