PDA

View Full Version : Remove old Kernels?


thebean
15th June 2004, 12:20 PM
Hey all, if there were steps I should take to remove older kernel versions? I'd hate to keep them from piling up.

I guess I should first be asking if it's safe to remove the old kernel?

Right now I just edit /etc/grub.conf and remove the boot option for the previous kernel. Anything else I can do?

Thanks

TheBean

Jman
15th June 2004, 02:42 PM
If you can boot from the new one, it should be safe. Keeping the old one leaves it for backup if something should go wrong.

To remove it run as root rpm -e kernel-version in a terminal (Main Menu > System Tools > Terminal) where version is the full release number. Enter rpm -q kernel to get the installed kernels.

crackers
15th June 2004, 05:11 PM

Using the rpm command will also clean up your grub.conf, by the way...

thebean
15th June 2004, 06:30 PM
thanks!

ashmew2
20th May 2009, 07:41 AM
Such an old thread but still works like a charm...Thank You :)

pixaroglets
27th June 2009, 08:24 PM
damn right! :)

Diomedea
1st October 2009, 11:47 AM
One observation: those who have the nvidia driver installed have to first remove the kmod package for the kernel version they want to eliminate. That can be done with Add/Remove Software.

JuanC
2nd December 2009, 06:37 AM
One observation: those who have the nvidia driver installed have to first remove the kmod package for the kernel version they want to eliminate. That can be done with Add/Remove Software.
You can do better by using yum:
yum remove kernel-version it will also remove dependencies like nvidia kmods

smurffit
10th December 2009, 10:01 PM
Does someone has an idea how to remove self-compiled kernel which were made with make && make_modules && make install?

marko
10th December 2009, 10:37 PM
Another good way is to have yum remove the oldest Nth kernel whenever the next kernel is installed by editing the /etc/yum.conf file
to put in (3 kernels retained for an example)

installonlyn = 3

or you can edit the file in
/etc/yum/pluginconf.d/installonlyn.conf

to set the number you want.

sambo
19th December 2010, 07:23 PM
I had previously updated from FC10 to FC11. Now I'm wanting to continue updating to newer kernels but attempts to remove old kernels are unsucessful due to failed depedencies as yum remove and rpm -e both fail with a diagnostic message.

rpm -e kernel-2.6.30.9-102.fc11.x86_64
error: Failed dependencies:
kernel-uname-r = 2.6.27.29-170.2.78.fc10.x86_64 is needed by (installed) kmod-nvidia-2.6.27.29-170.2.78.fc10.x86_64-180.60-1.fc10.1.x86_64
kernel-uname-r = 2.6.27.30-170.2.82.fc10.x86_64 is needed by (installed) kmod-nvidia-2.6.27.30-170.2.82.fc10.x86_64-180.60-1.fc10.3.x86_64

What do I need to do in order to successfully remove the old kernel?

forkbomb
21st December 2010, 07:47 AM
I had previously updated from FC10 to FC11.[...]
What do I need to do in order to successfully remove the old kernel?If that means you're now running F11, the best course of action would be to just update to a supported version....
http://fedoraproject.org/wiki/LifeCycle/EOL

GeekGirl1
11th June 2011, 09:46 PM
Thanks. This old thread is still working for Fedora 15.

To see what you have:
yum info kernel

Then, remove the old ones you don't want. Version is the number reported by yum info kernel, such as kernel-2.6.38.6:
sudo yum remove kernel-version

The uninstall process did remove a dependency on kmod-nVidia, as well as update /boot/grub.conf.

PiElle
17th June 2011, 03:28 PM
Very useful! Thank You! :)

PiElle
12th July 2011, 06:56 PM
If you run a Kernel PAE, don't forget:
yum info kernel-PAE
and
sudo yum remove kernel-PAE-version

I wrote this, because having now installed a kernel PAE I couldn't find any voice, until I typed:
rpm -qa *\kernel\*|sort :doh:
all's well that ends well ... :)

scaryAardvark
28th September 2011, 04:31 PM
I always use

$ package-cleanup --oldkernels --count 1

leosubhadeep
22nd August 2012, 12:49 AM
Old thread, but became very useful. Thanks. :)