Linux基础——BCeuler21.10内核升级
Linux基础——BCeuler21.10内核升级
一、准备升级的kernel包
[root@harbor kernel]# ls
kernel-4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64.rpm kernel-devel-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64.rpm
kernel-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64.rpm kernel-tools-4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64.rpm
kernel-devel-4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64.rpm kernel-tools-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64.rpm
二、确认当前kernel版本
[root@harbor kernel]# rpm -qa | grep kernel
texlive-l3kernel-svn48022-24.oe1.noarch
kernel-tools-4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64
kernel-devel-4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64
kernel-4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64
三、升级kernel
[root@harbor kernel]# yum localinstall kernel*-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64.rpm
Last metadata expiration check: 0:23:56 ago on Tue 06 Aug 2024 02:20:59 PM CST.
Dependencies resolved.
==============================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================
Installing:
kernel x86_64 4.19.90-2107.6.0.0251.43.oe1.bclinux @commandline 44 M
Upgrading:
kernel-devel x86_64 4.19.90-2107.6.0.0251.43.oe1.bclinux @commandline 13 M
kernel-tools x86_64 4.19.90-2107.6.0.0251.43.oe1.bclinux @commandline 324 k
Transaction Summary
==============================================================================================================================
Install 1 Package
Upgrade 2 Packages
Total size: 58 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: kernel-tools-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64 1/1
Upgrading : kernel-tools-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64 1/5
Running scriptlet: kernel-tools-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64 1/5
Upgrading : kernel-devel-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64 2/5
Running scriptlet: kernel-devel-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64 2/5
Installing : kernel-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64 3/5
Running scriptlet: kernel-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64 3/5
Cleanup : kernel-devel-4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64 4/5
Running scriptlet: kernel-tools-4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64 5/5
Cleanup : kernel-tools-4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64 5/5
Running scriptlet: kernel-tools-4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64 5/5
Running scriptlet: kernel-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64 5/5
Running scriptlet: kernel-tools-4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64 5/5
Verifying : kernel-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64 1/5
Verifying : kernel-devel-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64 2/5
Verifying : kernel-devel-4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64 3/5
Verifying : kernel-tools-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64 4/5
Verifying : kernel-tools-4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64 5/5
Upgraded:
kernel-devel-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64 kernel-tools-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64
Installed:
kernel-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64
Complete!
四、确认升级后kernel包版本
[root@harbor kernel]# rpm -qa | grep kernel
kernel-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64
texlive-l3kernel-svn48022-24.oe1.noarch
kernel-devel-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64
kernel-4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64
kernel-tools-4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64
[root@harbor kernel]# uname -r
4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64
注:重启主机后新内核才会生效
五、查看系统boot所有kernel版本
[root@harbor kernel]# cat /boot/grub2/grub.cfg |grep "menuentry"
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
menuentry_id_option=""
export menuentry_id_option
menuentry 'BigCloud Enterprise Linux (4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64) 21.10 (LTS-SP2)' --class bigcloud --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.19.90-2107.6.0.0227.28.oe1.bclinux.x86_64-advanced-1624fa73-8ed0-4870-bfc6-d98748252a89' {
menuentry 'BigCloud Enterprise Linux (4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64) 21.10 (LTS-SP2)' --class bigcloud --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-4.19.90-2107.6.0.0227.28.oe1.bclinux.x86_64-advanced-1624fa73-8ed0-4870-bfc6-d98748252a89' {
menuentry 'BigCloud Enterprise Linux (0-rescue-d24f36113bef4feb89c6b7fe93b524d4) 21.10 (LTS-SP2)' --class bigcloud --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-d24f36113bef4feb89c6b7fe93b524d4-advanced-1624fa73-8ed0-4870-bfc6-d98748252a89' {
grub2-set-bootflag grub2-set-default grub2-set-password grub2-setpassword
六、修改默认启动内核版本
[root@harbor kernel]# grub2-set-default "BigCloud Enterprise Linux (4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64) 21.10 (LTS-SP2)"
七、确认升级后,默认启动内核版本
[root@harbor kernel]# grub2-editenv list
saved_entry=BigCloud Enterprise Linux (4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64) 21.10 (LTS-SP2)
boot_success=0
boot_indeterminate=0
[root@harbor kernel]# uname -r
4.19.90-2107.6.0.0192.8.oe1.bclinux.x86_64
八、重启,启用升级后内核
[root@harbor kernel]# reboot
九、检查当前使用内核
[root@harbor kernel]# uname -r
4.19.90-2107.6.0.0251.43.oe1.bclinux.x86_64