How to remove old unused Kernel from CentOS 7

When you update the CentOS Linux, the update add a new kernel image in the system but update will not remove your old kernel. To remove these unused kernel .you can used yum command .

Firstly you check which kernel is running on your Machine.

[root@localhost ~]# uname -r
3.10.0-693.21.1.el7.x86_64

Below are the list of installed kernel on your CentOS machine

[root@localhost ~]# rpm -qa kernel
kernel-3.10.0-693.5.2.el7.x86_64
kernel-3.10.0-693.11.1.el7.x86_64
kernel-3.10.0-514.10.2.el7.x86_64
kernel-3.10.0-693.21.1.el7.x86_64
kernel-3.10.0-693.17.1.el7.x86_64
[root@localhost ~]#

You can use yum command to remove old unused kernel from the CentOS Linux

[root@localhost ~]# yum erase kernel-3.10.0-693.5.2.el7.x86_64
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
–> Running transaction check
—> Package kernel.x86_64 0:3.10.0-693.5.2.el7 will be erased
–> Finished Dependency Resolution

Dependencies Resolved

============================================================================
Package                                      Arch                      Version             Repository             Size
============================================================================
Removing:
kernel                                        x86_64            3.10.0-693.5.2.el7    @updates               59 M

Transaction Summary
============================================================================
Remove 1 Package

Installed size: 59 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : kernel-3.10.0-693.5.2.el7.x86_64 1/1
Verifying : kernel-3.10.0-693.5.2.el7.x86_64 1/1

Removed:
kernel.x86_64 0:3.10.0-693.5.2.el7

Complete!
[root@localhost ~]#

One thought on “How to remove old unused Kernel from CentOS 7

  1. Pingback: Ho to Configure yum utility to auto-remove old unused kernels | The Linux Operating System (CentOS / Red Hat / Fedora / Ubuntu / Scientific Linux / FreeBSD)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s