How to Remove old Kernels

How to remove old installed kernels after updates or upgrades. Old kernels can use up space on your Hard Disk. Its good to get in to the habit in cleaning out old kernels. It also helps with reclaiming hard disk space.

NOTE: This tip works for Fedora, RedHat, and Cent OS Distributions.


You need to be root in order to remove an old kernel so run the "su" command and switch to root.

# su

1

Now run "rpm -q kernel" to see what kernels are installed on your computer.

# rpm -q kernel

2

As you can see I have two kernels installed on this system. In this case I am going to remove kernel-3.8.4-202.fc18.x86_64 so run

# yum remove kernel-3.8.4-202.fc18.x86_64

3

Hit y to continue.

4

That's it. The kernel is now removed.

5

Run "rpm -q kernel" command again. As you can see there is only one kernel installed.

# rpm -q kernel

6

That's how you uninstall old kernels from your system. I hope this helped thanks for reading.