rockylinux 9.2
# uname -r
5.14.0-284.11.1.el9_2.x86_64
网站:http://mirrors.coreix.net/elrepo-archive-archive/kernel/el9/x86_64/RPMS/
# ll
-rw-r--r-- 1 root root 36889 Oct 30 13:38 kernel-lt-6.1.80-1.el9.elrepo.x86_64.rpm
-rw-r--r-- 1 root root 48351469 Oct 30 13:38 kernel-lt-core-6.1.80-1.el9.elrepo.x86_64.rpm
-rw-r--r-- 1 root root 47088209 Oct 30 13:38 kernel-lt-modules-6.1.80-1.el9.elrepo.x86_64.rpm
# dnf localinstall kernel-lt-modules-6.1.80-1.el9.elrepo.x86_64.rpm kernel-lt-core-6.1.80-1.el9.elrepo.x86_64.rpm kernel-lt-6.1.80-1.el9.elrepo.x86_64.rpm
# grubby --info=ALL
index=0
kernel="/boot/vmlinuz-6.1.80-1.el9.elrepo.x86_64"
args="ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=UUID=37d95302-4572-4e3a-bc91-4c2e021c3dd8 rhgb quiet selinux=0 $tuned_params"
root="UUID=60696a7d-a8d5-4eb9-bbf3-dc207ff90fa8"
initrd="/boot/initramfs-6.1.80-1.el9.elrepo.x86_64.img $tuned_initrd"
title="Rocky Linux (6.1.80-1.el9.elrepo.x86_64) 9.2 (Blue Onyx)"
id="a674b449cbd146d79b33888bb5ad39c4-6.1.80-1.el9.elrepo.x86_64"
index=1
kernel="/boot/vmlinuz-5.14.0-284.11.1.el9_2.x86_64"
args="ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=UUID=37d95302-4572-4e3a-bc91-4c2e021c3dd8 rhgb quiet selinux=0 $tuned_params"
root="UUID=60696a7d-a8d5-4eb9-bbf3-dc207ff90fa8"
initrd="/boot/initramfs-5.14.0-284.11.1.el9_2.x86_64.img $tuned_initrd"
title="Rocky Linux (5.14.0-284.11.1.el9_2.x86_64) 9.2 (Blue Onyx)"
id="a674b449cbd146d79b33888bb5ad39c4-5.14.0-284.11.1.el9_2.x86_64"
index=2
kernel="/boot/vmlinuz-0-rescue-a674b449cbd146d79b33888bb5ad39c4"
args="ro crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=UUID=37d95302-4572-4e3a-bc91-4c2e021c3dd8 rhgb quiet selinux=0"
root="UUID=60696a7d-a8d5-4eb9-bbf3-dc207ff90fa8"
initrd="/boot/initramfs-0-rescue-a674b449cbd146d79b33888bb5ad39c4.img"
title="Rocky Linux (0-rescue-a674b449cbd146d79b33888bb5ad39c4) 9.2 (Blue Onyx)"
id="a674b449cbd146d79b33888bb5ad39c4-0-rescue"
从上面看到内核 6.1.80 索引为0,所以这里设置默认内核为0(可能新装的内核索引直接从0开始)
# grubby --default-kernel
/boot/vmlinuz-6.1.80-1.el9.elrepo.x86_64
# grubby --set-default 0
如果第2步查看现在系统默认版本就是新装的版本这一步就不需要执行(执行了也没问题)
# uname -r
6.1.80-1.el9.elrepo.x86_64
升级内核完成