I might be encountering odd symptoms resulting from competing kernels in CentOS 7. So how do I safely delete the old kernels? And how do I know which kernel is the newest one?
Below is the terminal output I get at the moment when researching this on the server in question. Note that I tried package-cleanup but it leaves the same 2 kernels:
The instructions in this tutorial say that the output of the following two commands should match, but you can see that they do not match, even after a reboot:
[root@localhost ~]# rpm -qa kernel |sort -V |tail -n 1 kernel-3.10.0-229.el7.x86_64 [root@localhost ~]# uname -r 3.10.0-229.14.1.el7.x86_64
The remaining commands confirm that there are two kernels, and illustrate attempts to delete the old one.
[root@localhost ~]# cd /usr/src/kernels [root@localhost kernels]# ls -al total 16 drwxr-xr-x. 4 root root 4096 Oct 2 12:55 . drwxr-xr-x. 4 root root 4096 Oct 2 13:15 .. drwxr-xr-x. 22 root root 4096 Oct 2 12:55 3.10.0-229.14.1.el7.x86_64 drwxr-xr-x. 22 root root 4096 Oct 2 12:35 3.10.0-229.el7.x86_64 [root@localhost kernels]# rpm -q kernel kernel-3.10.0-229.el7.x86_64 kernel-3.10.0-229.14.1.el7.x86_64 [root@localhost kernels]# package-cleanup --oldkernels=1 Loaded plugins: fastestmirror Usage: package-cleanup: helps find problems in the rpmdb of system and correct them usage: package-cleanup --problems or --leaves or --orphans or --oldkernels Command line error: --oldkernels option does not take a value [root@localhost kernels]# package-cleanup --oldkernels Loaded plugins: fastestmirror No old kernels to remove [root@localhost kernels]# rpm -q kernel kernel-3.10.0-229.el7.x86_64 kernel-3.10.0-229.14.1.el7.x86_64 [root@localhost kernels]#
I also opened up
/etc/yum.conf and set
installonly_limit=1, but this resulted in an error from a subsequent
yum update command saying that 1 is outside the range of acceptable values for
I assume that
3.10.0-229.14.1.el7.x86_64 is the newest, but how can I know this? Also, the boot options seem to offer multiple kernels to choose from. And the opportunities for confusion get worse when the system auto-boots from the first kernel on the list of options.
Can someone please explain how this works, and in specific, how to safely delete old kernels so that kernel version can be eliminated as a possible cause of odd symptoms? I want to make sure that the most recent kernel is the only kernel that can ever run, no matter how the system is restarted.