一、CentOS 7.9 升級內核 kernel-ml-5.6.14版本
地址
http://193.49.22.109/elrepo/kernel/el7/x86_64/RPMS
默認內核版本為3.10.0,現升級到 5.6.14 版本
查看當前內核版本
[root@localhost ~]# uname -r 3.10.0-1160.53.1.el7.x86_64
wget 下載
wget http://193.49.22.109/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-5.6.14-1.el7.elrepo.x86_64.rpm wget http://193.49.22.109/elrepo/kernel/el7/x86_64/RPMS/kernel-ml-devel-5.6.14-1.el7.elrepo.x86_64.rpm
安裝
[root@ecs-65685 ~]# rpm -ivh kernel-ml-5.6.14-1.el7.elrepo.x86_64.rpm warning: kernel-ml-5.6.14-1.el7.elrepo.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID baadae52: NOKEY Preparing... ################################# [100%] Updating / installing... 1:kernel-ml-5.6.14-1.el7.elrepo ################################# [100%] [root@ecs-65685 software]# rpm -ivh kernel-ml-devel-5.6.14-1.el7.elrepo.x86_64.rpm warning: kernel-ml-devel-5.6.14-1.el7.elrepo.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID baadae52: NOKEY Preparing... ################################# [100%] Updating / installing... 1:kernel-ml-devel-5.6.14-1.el7.elre################################# [100%]
查看當前內核
[root@ecs-65685 ~]# cat /boot/grub2/grub.cfg |grep ^menuentry menuentry 'CentOS Linux (5.6.14-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-f5954a19-b069-42e4-a6ca-3a1cd06d0735' { menuentry 'CentOS Linux (3.10.0-1160.53.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-f5954a19-b069-42e4-a6ca-3a1cd06d0735' { 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-f5954a19-b069-42e4-a6ca-3a1cd06d0735' { menuentry 'CentOS Linux (0-rescue-acca19161ce94d449c58923b12797030) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-acca19161ce94d449c58923b12797030-advanced-f5954a19-b069-42e4-a6ca-3a1cd06d0735' {
設置啟動內核
[root@ecs-65685 ~]# grub2-set-default 0 # 或者 grub2-set-default 'CentOS Linux (5.6.14-1.el7.elrepo.x86_64) 7 (Core)'
重新生成一個grub2配置文件
[root@ecs-65685 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.6.14-1.el7.elrepo.x86_64 Found initrd image: /boot/initramfs-5.6.14-1.el7.elrepo.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-1160.53.1.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-1160.53.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-acca19161ce94d449c58923b12797030 Found initrd image: /boot/initramfs-0-rescue-acca19161ce94d449c58923b12797030.img done
重啟系統
[root@ecs-65685 ~]# reboot
確認下是否啟動默認內核指向上面安裝的內核
[root@ecs-65685 ~]# grubby --default-kernel /boot/vmlinuz-5.6.14-1.el7.elrepo.x86_64
確認使用的內核版本
uname -r