依赖使用的rpm包
[root@localhost myyum]# ls -lrt
total 126104
-rw-r--r--. 1 root root 76948992 May 14 2019 linux-firmware-20190429-72.gitddde598.el7.noarch.rpm
-rw-r--r--. 1 root root 52176080 Nov 11 16:45 kernel-3.10.0-1062.9.1.el7.x86_64.rpm
安装过程
[root@localhost myyum]# rpm -Uvh linux-firmware-20190429-72.gitddde598.el7.noarch.rpm
warning: linux-firmware-20190429-72.gitddde598.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:linux-firmware-20190429-72.gitddd################################# [ 50%]
Kernel version 3.10.0-957.el7.x86_64 has no module directory /lib/modules/3.10.0-957.el7.x86_64
Cleaning up / removing...
2:linux-firmware-20180911-69.git85c################################# [100%]
[root@localhost myyum]#
[root@localhost myyum]# rpm -Uvh kernel-3.10.0-1062.9.1.el7.x86_64.rpm
warning: kernel-3.10.0-1062.9.1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:kernel-3.10.0-1062.9.1.el7 ################################# [100%]
[root@localhost myyum]#
[root@localhost myyum]# rpm -qa|grep kernel
kernel-tools-3.10.0-957.el7.x86_64
kernel-3.10.0-1062.9.1.el7.x86_64
kernel-tools-libs-3.10.0-957.el7.x86_64
[root@localhost myyum]#
[root@localhost myyum]# grep initrd16 /boot/grub2/grub.cfg #安装完成后检查/boot/grub2/grub.cfg中对应内核menuentry中是否包含安装的内核版本,如果没有再安装一次
initrd16 /initramfs-3.10.0-1062.9.1.el7.x86_64.img
initrd16 /initramfs-0-rescue-debcad48335247cabb0c3ba972c6b788.img
[root@localhost myyum]#
[root@localhost myyum]# awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg #查看默认启动顺序
Red Hat Enterprise Linux Server (3.10.0-1062.9.1.el7.x86_64) 7.6 (Maipo)
Red Hat Enterprise Linux Server (0-rescue-debcad48335247cabb0c3ba972c6b788) 7.6 (Maipo)
[root@localhost myyum]#
[root@localhost myyum]# grub2-set-default 'Red Hat Enterprise Linux Server (3.10.0-1062.9.1.el7.x86_64) 7.6 (Maipo)' #设置默认内核启动
[root@localhost myyum]# init 6 重启
[root@localhost ~]# uname -a #重启后,内核生效
Linux localhost.localdomain 3.10.0-1062.9.1.el7.x86_64 #1 SMP Mon Dec 2 08:31:54 EST 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]#