Remove Old Kernels on Fedora

A quick tip to remove old kernels from fedora and also limit how many kernels you want to keep. The main reason to remove kernels is Disk Space.

Installed Kernels

rpm -q kernel

The above command displays the kernel installed on the system.

Remove Old Kernels

## Install yum utils ##
yum install yum-utils
## Package-cleanup keeps the kernels that you want ##
package-cleanup --oldkernels --count=2

Make Number of Installed Kernels Permanent

Edit /etc/yum.conf and set installonly_limit: