How to find out the previous kernel version on CentOS after a reboot

To find out the previous kernel version on CentOS after a reboot, you can use the rpm command to query the package database. Here are the steps:

Open a terminal or SSH session to your CentOS server.

Type the following command to list all installed kernels:

rpm -qa | grep "kernel-[0-9]"

This will output a list of all installed kernel packages.

rpm -qa | grep “kernel-[0-9]”

kernel-3.10.0-962.3.2.lve1.5.75.el7.x86_64
kernel-3.10.0-962.3.2.lve1.5.73.el7.x86_64
kernel-3.10.0-962.3.2.lve1.5.76.el7.x86_64
kernel-3.10.0-962.3.2.lve1.5.70.el7.x86_64
kernel-3.10.0-962.3.2.lve1.5.77.el7.x86_64

Look for the kernel package with the highest version number that is not the currently running kernel. This will be the previous kernel version.

Double check your /var/log/messages file to see kernel’s version before and after a reboot

less /var/log/messages |grep 10.0-962.3.2

To verify the kernel version, you can use the uname command. Type the following command:

uname -r

This will output the currently running kernel version.

Note: If you have not removed any old kernels manually, CentOS typically keeps the last three kernel versions installed on the system.

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *