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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-21-2007, 03:41 PM
|
#1
|
LQ Newbie
Registered: Feb 2007
Posts: 22
Rep:
|
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.
|
02-21-2007, 03:43 PM
|
#2
|
Senior Member
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,410
Rep: 
|
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.
|
|
|
02-21-2007, 03:49 PM
|
#3
|
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131
Rep: 
|
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.
|
|
|
02-21-2007, 03:56 PM
|
#4
|
Senior Member
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,410
Rep: 
|
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?
|
|
|
02-21-2007, 05:13 PM
|
#5
|
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:
|
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.
|
10-22-2021, 04:41 PM
|
#6
|
Member
Registered: Dec 2006
Distribution: Ubuntu 20.04
Posts: 87
Rep:
|
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.
|
|
|
10-24-2021, 11:22 AM
|
#7
|
LQ Guru
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, OS/2, others
Posts: 6,347
|
Quote:
Originally Posted by Brian1
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.
|
|
|
10-24-2021, 11:26 AM
|
#8
|
LQ Guru
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, OS/2, others
Posts: 6,347
|
Quote:
Originally Posted by haxpor
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 11:29 AM.
|
|
|
All times are GMT -5. The time now is 03:38 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|