LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-23-2006, 07:40 PM   #1
Freestone
Member
 
Registered: Jan 2003
Location: Brighton, Michigan
Distribution: FC5
Posts: 114

Rep: Reputation: 15
How do you remove a kernel?


Just wondering... if I have installed two or three kernels for various reasons, how do I remove one of them?
Do I just delete the contents of /lib/modules/2.6.15....? Am I at risk of doing damage? Right now I have the original kernel from installing FC5 which is 2.6.15-1.2054 and I downloaded another kernel with patches in it so I could install and run ndiswrapper so I can use my wireless card. I only boot into the kernel with the patches so can I delete the original kernel and just keep the one that I am using, and if I can delete it, is it as easy as removing its directory from /lib/modules?

Thanks for any input.
 
Old 09-23-2006, 07:44 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
If rpm installed kernel then using the complete name of the package use rhe rpm command.
Example: rpm -e kernel-2.6.15-1.2054

If kernel-devel matching kernel is installed you may have to delete them first.

Brian1
 
Old 09-23-2006, 07:45 PM   #3
Aeiri
Member
 
Registered: Feb 2004
Posts: 307

Rep: Reputation: 30
Since you are uding Fedora, remove the RPM that's associated with the older kernel.
 
Old 09-24-2006, 10:11 AM   #4
Freestone
Member
 
Registered: Jan 2003
Location: Brighton, Michigan
Distribution: FC5
Posts: 114

Original Poster
Rep: Reputation: 15
I wasn't clear in my original post.

I downloaded a kernel with patches in the form of a xxx.xxx.xx..src.rpm then
rpmbuild -bb /usr/src/redhat/kernel-2.6.15.spec and then compiled, built, blah blah
the kernel. It wasn't a flat out rpm that installed itself. I had to build from source.

The kernel I want to remove is the default kernel that was installed with FC5 which
I believe is 2.6.15-1.2054.

I tried to remove it with: rpm -e kernel-2.6.15-1.2054_FC5 and got some dependency errors.

I just want to remove the original kernel. So would deleting the directory 2.6.15-1.2054_FC5 from /lib/modules do any harm?
 
Old 09-24-2006, 11:22 AM   #5
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
You should be able to remove the rpms by do the same steps but backwards from the way you did the install. Last step first.

Got me a bit confused but to remove manual this and that goto the following areas.
/lib/modules and remove the module directories attached to the kernel you wish gone.
/boot and remove the system.map, vmlinuz, and init attached to kernel you wish gone.
edit /boot/grub/grub.conf and remove the kernels you do not need installed.
/usr/src/redhat/ BUILD, RPMS, SRPMS, SPECS, SOURCES and travel through them and remove what is needed.

Now doing the above is all manual removal. This does not remove the info from the rpm database. So the rpm tools will still always beleive it to be there if they were installed as RPMs.

Now if you check the manpages on the rpm command ' man rpm '. You will see option like --force and --nodeps. If you used the --force with -e to remove the rpm it will remove it no matter if the data base so it can or not. Only issue it may cause dependiency issues with other packages. This can be a big pain to to get fixed. One of the issues with RPMs. Use at your own risk. Before trying I would learn all that can be learned about the RPM system. There more info than I can write about it in this single post.

Brian1
 
Old 09-24-2006, 04:56 PM   #6
Freestone
Member
 
Registered: Jan 2003
Location: Brighton, Michigan
Distribution: FC5
Posts: 114

Original Poster
Rep: Reputation: 15
Thank you!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Which Kernel to remove? bkz81 Mandriva 7 04-28-2006 04:33 AM
How to remove this old kernel? halo14 Debian 6 04-12-2006 08:31 AM
kernel compilation : to remove a kernel which files should be deleted b0nd Linux - Newbie 2 08-17-2005 12:35 PM
how do I remove new kernel? jmral23 Linux - Newbie 1 02-09-2005 06:48 PM
remove kernel collimate Linux - Newbie 4 12-03-2003 03:37 AM


All times are GMT -5. The time now is 12:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration