Rightly updating the Linux kernel can be done in two ways.
1. Manually install the .rpm kernel package
To manually install a kernel, the best practice is to use the – i option and not the – U option. The reason is that the –U option will update the kernel and not keep the old kernel.
2. Using the “yum install” or “yum update” command
The kernel can also be updated using the “yum update” command and the old kernel will not be overwritten.
OPTION A:manually installing the .rpm package
1. download the rpm package: you can use the Red Hat package browser to find the kernel you want to install. In this case, the kernel that is going to be installed is [ kernel-3.10.0-862.2.3.el7.x86_64.rpm ]
2. Before we install, it is good to confirm the number of kernels installed on the system
[root@testhost1 ~]# rpm -qa kernel
kernel-3.10.0-862.el7.x86_64
[root@testhost1 ~]#
You can see that there is only one kernel on the system and that is the kernel the system is using.
NOTE: if there are many kernels on the system, use the command “uname -r” to know the kernel the system is running on
3. Installing,
[root@testhost1 ~]# rpm -ivh kernel-3.10.0-862.2.3.el7.x86_64.rpm
warning: kernel-3.10.0-862.2.3.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing… ################################# [100%]
Updating / installing…
1:kernel-3.10.0-862.2.3.el7 ################################# [100%]
[root@testhost1 ~]#
4. reboot the system to make it start with the new kernel.
[root@rhel8 ~]# reboot
5. confirm the new kernel after start up
[root@testhost1 ~]# uname -r
3.10.0-862.2.3.el7.x86_64
[root@testhost1 ~]#
OPTION B: using the “yum update” command.
1. use “yum update kernel” command to update the kernel
[root@rhel8 ~]# yum update kernel
2. reboot the system to make it start with the new kernel.
[root@rhel8 ~]# reboot
3. confirm the new kernel after the system is booted up.
[root@testhost1 ~]# uname -r
3.10.0-862.2.3.el7.x86_64
[root@testhost1 ~]#