Removing old kernel OEL6 and OEL5

This article presents how to remove old kernels on OEL5 and OEL6.

Removing old kernels is pretty simple. In this article I show how to do it on OEL5 but it works in the same way on OEL6.

1. Check kernels which are installed on your system.

[root@oel5 ~]# rpm -qa | grep kernel
kernel-uek-2.6.39-400.21.2.el5uek
kernel-uek-2.6.39-300.26.1.el5uek
kernel-headers-2.6.18-348.4.1.0.1.el5
kernel-uek-devel-2.6.39-400.21.2.el5uek
kernel-uek-firmware-2.6.39-300.26.1.el5uek
kernel-uek-firmware-2.6.39-400.109.1.el5uek
kernel-uek-firmware-2.6.39-400.21.2.el5uek
kernel-2.6.18-348.4.1.0.1.el5
kernel-debug-2.6.18-348.4.1.0.1.el5
kernel-xen-2.6.18-348.4.1.0.1.el5
kernel-2.6.18-348.el5
kernel-debug-2.6.18-348.el5
kernel-devel-2.6.18-348.4.1.0.1.el5
kernel-xen-2.6.18-348.el5
kernel-uek-devel-2.6.39-400.109.1.el5uek
kernel-devel-2.6.18-348.el5
kernel-uek-devel-2.6.39-300.26.1.el5uek
kernel-uek-2.6.39-400.109.1.el5uek

2. Check your current kernel which you are using

[root@oel5 ~]# uname -r
2.6.39-400.109.1.el5uek

3. Remove old kernel(s) using command: yum remove kernel-package

It’s just example for removing one kernel

[root@oel5 ~]# yum remove kernel-2.6.18-348.el5
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
You can use up2date --register to register.
ULN support will be disabled.
Setting up Remove Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider 
running yum-complete-transaction first to finish them.
The program yum-complete-transaction is found 
in the yum-utils package.
--> Running transaction check
---> Package kernel.x86_64 0:2.6.18-348.el5 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================
 Package    Arch        Version         Repository           Size
=====================================================================
Removing:
 kernel     x86_64      2.6.18-348.el5  installed            99 M

Transaction Summary
=====================================================================
Remove        1 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing        : kernel                      1/1 

Removed:
  kernel.x86_64 0:2.6.18-348.el5

Complete!

Have a fun 🙂

Tomasz

 

 

 

Leave a Reply

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