Loading...
Real Time Concepts

How to Delete Old Unused Kernels in Alma Linux,CentOS, RHEL

To display the current version of Linux (kernel) running on your system, run this command.

# uname -sr

You can list all kernel images installed on your system like this.

# rpm -q kernel

kernel-3.10.0-229.el7.x86_64
kernel-3.10.0-229.14.1.el7.x86_64
kernel-3.10.0-327.3.1.el7.x86_64
kernel-3.10.0-327.10.1.el7.x86_64

One of these utilities is package-cleanup which you can use to delete old kernel as shown below, the count flag is used to specify the number of kernels you want to leave on the system.

# package-cleanup –oldkernels –count=2

Leave a Reply

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