运维|Anolis龙蜥升级kernel

使用grubby查看已存在kernel

$ grubby --info=ALL | grep ^kernel kernel="/boot/vmlinuz-4.18.0-193.60.2.an8_2.x86_64" kernel="/boot/vmlinuz-0-rescue-9debcaef38144ef88888c15d6c3d090f"

查看默认kernel
$ grubby --default-kernel /boot/vmlinuz-4.18.0-193.60.2.an8_2.x86_64

获取kernel 二进制安装包
# kernel包链接 https://www.yuque.com/anolis-docs/product-policy/kernel-lifecycle $ wget https://mirrors.openanolis.cn/anolis/8.4/Plus/x86_64/os/Packages/kernel-4.19.91-23.4.an8.x86_64.rpm $ wget https://mirrors.openanolis.cn/anolis/8.4/Plus/x86_64/os/Packages/kernel-core-4.19.91-23.4.an8.x86_64.rpm $ wget https://mirrors.openanolis.cn/anolis/8.4/Plus/x86_64/os/Packages/kernel-modules-4.19.91-23.4.an8.x86_64.rpm

安装kernel
## 安装kernel 需要先安装同版本的kernel-core和kernel-modules # 两个依赖没有安装顺序 rpm -ivh kernel-core-4.19.91-23.4.an8.x86_64.rpm rpm -ivh kernel-modules-4.19.91-23.4.an8.x86_64.rpm rpm -ivh kernel-4.19.91-23.4.an8.x86_64.rpm

设置默认kernel
$ grubby --info=ALL |grep ^kernel # 查看已存在的kernel kernel="/boot/vmlinuz-4.19.91-23.4.an8.x86_64" kernel="/boot/vmlinuz-4.18.0-193.60.2.an8_2.x86_64" kernel="/boot/vmlinuz-0-rescue-9debcaef38144ef88888c15d6c3d090f"$ grubby --set-default=/boot/vmlinuz-4.19.91-23.4.an8.x86_64 # 设置默认kernel## 重新启动并查看内核 $ grubby --default-kernel /boot/vmlinuz-4.19.91-23.4.an8.x86_64

    推荐阅读