LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-21-2007, 02:41 PM   #1
Aerolinux
LQ Newbie
 
Registered: Feb 2007
Posts: 22

Rep: Reputation: 15
Remove custom kernel


Hi could anyone tell me the procedure for remvoing a custom kernel ?? I built one and now I want to remove it since my driver appears to work in the deafult. Please give me the steps/commands.

Thank you.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-21-2007, 02:43 PM   #2
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
IMO, the easiest way for the newbie is to boot into the kernel you want to use and then use the synaptic package manager to remove the one you don't want.
 
Old 02-21-2007, 02:49 PM   #3
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
If the new kernel was built from source code (and not installed from a .deb file or Synaptic), then it can't be removed using Yum. Instead one should just be able to boot the kernel you want to use, then just remove the old kernel files from /boot/. One can also remove the _old_ kernel source from /usr/src/ if it's not needed, but if the modules were compiled against this custom kernel, make sure they work with your other kernel before removing the custom one. I'm pretty sure kernel.org has some information about all this (should be in the README file that comes along the kernel source code, too), and if you haven't yet, it's a good idea to do a quick search from the web.
 
Old 02-21-2007, 02:56 PM   #4
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
I guess I'm just too coddled by Debian. Won't he have to modify his grub or lilo lists if he removes files by hand?
 
Old 02-21-2007, 04:13 PM   #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: 65
For manually remove of customed compiled kernels.

Whether using grub or lilo you need to remove the section of that kernel from it. Grub you need to edit /boot/grub/grub.conf or 1st.menu and save the file. Lilo I forget how to do that. I know after edit you need to run the command lilo.
Remove the kernel image, system.map, and initrd that matches the kernel version to remove in /boot.
Remove the kernel source from /usr/src.
And last remove the /lib/modules/<kernel-version-of-modules>

Brian
 
2 members found this post helpful.
Old 10-22-2021, 03:41 PM   #6
haxpor
Member
 
Registered: Dec 2006
Distribution: Ubuntu 20.04
Posts: 87

Rep: Reputation: 15
I knew this is so many years.
Just to expand on Brian1's reply which helps me as well.

I'm on Ubuntu 20.04, and for custom manual built kernel. The following is the files I need to remove

* /boot/config-<kernel-version>
* /boot/initrd.img-<kernel-version>
* /boot/System.map-<kernel-version>
* /boot/vmlinuz-<kernel-version>

After that, execute sudo update-grub. The grub entries will be updated automatically as its scripts inside /etc/grub.d will automatically detect files inside /boot then update accordingly. Note that /boot/grub/grub.cfg is not meant to be directly edit as noted inside the file as "DO NOT EDIT THIS FILE".

It might be in 2007 things might be different from now. But yeah, I just add this updated info for later new users reading this.
 
Old 10-24-2021, 10:22 AM   #7
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,804
Blog Entries: 1

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
Quote:
Originally Posted by Brian1 View Post
Whether using grub or lilo you need to remove the section of that kernel from it. Grub you need to edit /boot/grub/grub.conf or 1st.menu and save the file.
/boot/grub/grub.conf may possibly exist in no current distros. In many it never did. Others used /boot/grub/menu.lst for the original Grub. Most distros now use Grub2, so the relevant file is /boot/grub/grub.cfg or /boot/grub2/grub.cfg/, which is warned not to disturb, because there's an automatic system to regenerate it whenever a kernel is added or removed by the distro's package management system.
 
Old 10-24-2021, 10:26 AM   #8
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,804
Blog Entries: 1

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
Quote:
Originally Posted by haxpor View Post
After that, execute sudo update-grub.
That's relevant only in some distros. Update-grub is not part of upstream Grub2 source. The official menu file regenerator is grub-mkconfig, which in some distros is grub2-mkconfig.

Last edited by mrmazda; 10-24-2021 at 10:29 AM.
 
  


Reply



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
Custom kernel image on custom slack build using CUSS nykey Slackware 2 07-15-2006 03:05 AM
Kernel-Patch Debian Logo 2.6.2 not correctly working for custom kernel 2.6.11 smp deepclutch Debian 3 06-27-2005 03:59 AM
New FAQ topic: Should I edit my kernel configuration?/Should I build a custom kernel? chort *BSD 10 09-10-2004 11:15 PM
Slackware 10, custom 2.6.7 kernel, lilo, loads kernel very slowly entropyv Slackware 3 08-19-2004 06:06 PM
How does one remove the custom KNOPPIX graphics from a KNOPPIX HD Install? apache363 Linux - Distributions 2 03-29-2004 05:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:05 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
Open Source Consulting | Domain Registration