LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   removing kernels from grub (https://www.linuxquestions.org/questions/fedora-35/removing-kernels-from-grub-201906/)

buffed317 07-06-2004 05:13 PM

removing kernels from grub
 
everytime i update the kernel through yum it adds another boot option to grub. how do i remove the different kernel options from grub?

wiraone 07-06-2004 05:19 PM

do a 'rpm -qa | grep kernel' .. find the one that you need to remove and do
'rpm -e kernel-X.X.X-X.XXX' (where the Xs are the release number). This will remove the physical kernel of your system too and free up some space in your /boot directory and in /lib/modules too.

buffed317 07-06-2004 05:49 PM

the output of the rpm -qa | grep kernel and the out was:

kernel-source-2.6.5-1.358
kernel-utils-2.4-9.1.131
kernel-2.6.6-1.435
kernel-2.6.5-1.358
kernel-2.6.6-1.435.2.3

can i remove everything but kernel-2.6.6-1.435.2.3 or do i need the utils and source file?

robert_edwards 07-06-2004 08:05 PM

vim /etc/grub.conf

(if I recall correctly..?..?)

just compare the numbers in the entries, and remove the entries with the lower kernel versions, but remember to compare them word for word so that you know where to start/stop editing.

A simple answer to a simple question, I hope.

Basslord1124 07-06-2004 09:54 PM

yeah, just go to grub's config file and delete the entries associated with old kernel's. Had to do it myself recently.

flyfishin 07-06-2004 10:12 PM

Quote:

Originally posted by buffed317
the output of the rpm -qa | grep kernel and the out was:

kernel-source-2.6.5-1.358
kernel-utils-2.4-9.1.131
kernel-2.6.6-1.435
kernel-2.6.5-1.358
kernel-2.6.6-1.435.2.3

can i remove everything but kernel-2.6.6-1.435.2.3 or do i need the utils and source file?

First figure out which kernel you are running. You should be running the highest numbered one. In your case 2.6.6-1.435.2.3. If all is well you can remove 2.6.5-1.358 and 2.6.6-1.435. You can also remove that specific kernel-source package because it is for an old kernel. After removing that kernel source be sure to get the kernel-source for your current kernel. If you have the disk space keep it installed. Do not remove kernel-utils. if you want to find information on a package issue the command:

rpm -qi nameofrpm

wiraone 07-07-2004 01:49 AM

Removing the entries in /etc/grub.conf is a quick and dirty way of getting rid of the choices in the grub menu, but the physical kernel files will stay in the HD. Removing the unused kernel packages (using rpm -e) is the correct way to do.

vincebs 07-07-2004 10:44 PM

If you did not use an rpm to install your kernel, for example, if you compiled your own kernel, do the following:

1.) Remove the GRUB entry for the kernel (for example, kernel-2.6.7) in /boot/grub/menu.lst
2.) Delete the kernel files in the boot directory by typing: rm /boot/*2.6.7*
3.) Make sure /boot/vmlinuz and /boot/System.map are still symbolically linked to the files of an existing kernel.
4.) Delete the kernel's modules by deleting its folder in /lib/modules. For example, rm -drf 2.6.7

gabigrigore 07-08-2004 09:55 AM

if you have apt installed you can remove them from there. (I think, but I'm not sure, only if they were installed via rpm). I did this and everything was ok. Using Synaptic as a gui for apt will make the things even more easier. Hope that helped :)


All times are GMT -5. The time now is 02:52 PM.