Oracle Linux 7.9内核降级

万楷
2023-12-01

OL7.9内核降级

1、查看当前OS版本号:

# cat /etc/oracle-release 
Oracle Linux Server release 7.9

2、查看当前内核版本号:

# uname -r
5.4.17-2011.6.2.el7uek.x86_64

# cat /proc/version
Linux version 5.4.17-2011.6.2.el7uek.x86_64 (mockbuild@jenkins-172-17-0-2-64d560bf-4b94-4bde-a5f8-f55888be27a0) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39.0.3) (GCC)) #2 SMP Thu Sep 3 14:09:14 PDT 2020

3、查看已安装内核rpm包版本:

# rpm -qa|grep kernel
kernel-3.10.0-1160.el7.x86_64
kernel-headers-3.10.0-1160.el7.x86_64
kernel-uek-5.4.17-2011.6.2.el7uek.x86_64
kernel-tools-3.10.0-1160.el7.x86_64
kernel-tools-libs-3.10.0-1160.el7.x86_64

4、下载对应版本内核rpm升级包:

Linux7 网址:Oracle Linux 7 (x86_64) UEK Release 6 | Oracle, Software. Hardware. Complete.

Linux6 网址:Oracle Linux 6 (x86_64) UEK Release 4 | Oracle, Software. Hardware. Complete.

kernel-uek-firmware-4.1.12-124.63.3.1.el7uek.noarch
kernel-uek-devel-4.1.12-124.63.3.1.el7uek.x86_64
kernel-uek-4.1.12-124.63.3.1.el7uek.x86_64

5、使用rpm命令对内核进行降级:

rpm -Uvh --oldpackage kernel-uek-4.1.12-124.63.3.1.el7uek.x86_64.rpm kernel-uek-devel-4.1.12-124.63.3.1.el7uek.x86_64.rpm kernel-uek-firmware-4.1.12-124.63.3.1.el7uek.noarch.rpm

输出如下:

warning: kernel-uek-4.1.12-124.63.3.1.el7uek.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:kernel-uek-firmware-4.1.12-124.63################################# [ 25%]
   2:kernel-uek-4.1.12-124.63.3.1.el7u################################# [ 50%]
   3:kernel-uek-devel-4.1.12-124.63.3.################################# [ 75%]
Cleaning up / removing...
   4:kernel-uek-5.4.17-2011.6.2.el7uek################################# [100%]

可能需要依赖,手动安装rpm -ivh libdtrace-ctf-0.7.0-1.el7.x86_64.rpm

6、检查启动项:

awk -F\' '$1=="menuentry " {print i++ " : " $2}'  /boot/grub2/grub.cfg
0 : Oracle Linux Server 7.9, with Unbreakable Enterprise Kernel 4.1.12-124.63.3.1.el7uek.x86_64
1 : Oracle Linux Server (3.10.0-1160.el7.x86_64 with Linux) 7.9
2 : Oracle Linux Server (0-rescue-3dafeec3c07441df8c55b32fa245d20e with Linux) 7.9

7、选择启动项:

grub2-set-default 0

8、重启操作系统:

shutdown -r now

内核升级请参阅我的另一篇博客:Oracle Linux 7.9内核升级

注: 本文仅在测试环境中实验过,可能细节部分存在缺失,生产环境有升降级内核需求还请参阅Linux官方文档

 类似资料: