Click to See Complete Forum and Search --> : Removing kernels?
computeridiot
01-07-2004, 12:52 AM
I want to remove all kernels on my machine but the very first one 2.4.20-8. I have 2.4.20-20, 2.4.20-27.9, 2.4.20-28.9smp. i am new to this linux thing and have been playing around with the kernels to try to get the hang of this...i am learing a great deal, but i would like to start over with out doing a re-install. If i cant..oh well wont be the first time! I am running red hat 9
SuperNu
01-07-2004, 01:01 AM
If all of those kernels you have listed are installed by RPMs, then you can easily remove the RPM package. To do this, first open up a command prompt, su to root and type rpm -qa | grep kernel. This will query the RPM database and list all packages with kernel in the name. Then type rpm -e kernel-<version>. You are going to have to supply the kernel versions for each since RPM won't know which RPM to remove if you just typed rpm -e kernel. If you need more help, check out man rpm.
By the way, just make sure when you are removing old kernels, you don't accidently try to remove the kernel you are running.
--SN
computeridiot
01-07-2004, 01:10 AM
[root@x1-6-00-40-05-39-a5-71 root]# rpm -qa | grep kernel
kernel-pcmcia-cs-3.1.31-13
kernel-2.4.20-27.9
kernel-2.4.20-8
kernel-smp-2.4.20-28.9
kernel-module-alsa-0.9.8-1.fr_2.4.20_20.9
kernel-source-2.4.20-8
[root@x1-6-00-40-05-39-a5-71 root]# rpm -e kernel-module-alsa-*
error: package kernel-module-alsa-0.9.8-1.fr_2.4.20_20.9.i686.rpm is not installed
[root@x1-6-00-40-05-39-a5-71 root]#
it is right there isnt it???
computeridiot
01-07-2004, 01:19 AM
also what is....kernel-pcmcia-cs-3.1.31-13 do i need it? it was not there when i first installed rh9. And do i need to remove any config files or is everything gone? what about a make mrproper after i deleted the kernels?
SuperNu
01-07-2004, 01:27 AM
Ok, I see you are running ALSA also. Here is what I did to remove my old kernels. First, I downloaded the latest, 2.4.20-28.9, and rpm -ivh kernel-2.4.20-28.9.athlon.rpm and rpm -Uvh kernel-source-2.4.20-28.9.i386.rpm. Next, I rebooted my pc and selected Red Hat Linux (2.4.20-28.9) from the grub menu. Once X was up and running, I logged in, opened up a konsole, su to root and typed rpm -qa | grep kernel. I then typed rpm -e kernel-2.4.20-27.9 kernel-module-alsa-0.9.8-1.fr_2.4.20_27.9 kernel-ntfs-2.4.20-27.9. This removed those three RPMs. I then reinstalled the kernel-ntfs module from the Linux-NTFS Project (http://linux-ntfs.sourceforge.net) and rebuilt the alsa kernel modules (rpmbuild --rebuild --target athlon alsa-driver-0.9.8-1.fr.src.rpm) and installed (rpm -ivh kernel-module-alsa-0.9.8-1.fr_2.4.20_28.9.athlon.rpm) them. This brought my system up to full functionality.
If you want to continue to use ALSA, you are going to have to rebuild the RPM yourself (rpmbuild --rebuild --target <i386, i686, etc> alsa-driver-0.9.8-1.fr.src.rpm. FreshRPMs doesn't support Red Hat 9 anymore. I haven't had any luck with the 1.0.0-rc SRPMs that are provided.
Also, I believe that you have to provide the full version number when you have multiple versions of the same package installed (ie kernel), but not when there is only one (ie kernel-module-alsa-0.9.8).
All of the config files should be removed when you remove the RPM file. You only need to run make mrproper when you are compiling your own kernel and haven't cleaned up the source code from an old kernel compile. The only thing you might have to remove would be the old kernel module directories under /lib/modules. Those stay around only if you have installed modules that haven't been removed by RPM (ie nvidia). Hope this helps.
--SN
I don't know what kernel-pcmcia-cs-3.1.31-13. I assume it is for PCMCIA support, but I really don't know. I just leave it installed just in case.
computeridiot
01-07-2004, 01:57 AM
[root@x1-6-00-40-05-39-a5-71 cd]# rpm -ivh kernel-ntfs-*
Preparing... ########################################### [100%]
__________________________________________________ _____________________________
ERROR: This RPM cannot be installed yet.
This RPM requires kernel-2.4.20-20.9.
You already have it installed, but it is not running.
Please reboot and select that kernel, then retry the install.
__________________________________________________ _____________________________
error: %pre(kernel-ntfs-2.4.20-20.9) scriptlet failed, exit status 1
error: install: %pre scriptlet failed (2), skipping kernel-ntfs-2.4.20-20.9
[root@x1-6-00-40-05-39-a5-71 cd]#
i removed it ?
computeridiot
01-07-2004, 02:22 AM
[root@x1-6-00-40-05-39-a5-71 root]# rpm -e alsa-driver-*
error: Failed dependencies:
alsa-driver >= 0.9.0 is needed by (installed) kernel-module-alsa-0.9.8-1.fr_2.4.20_20.9
[root@x1-6-00-40-05-39-a5-71 root]#
i am lost here?
computeridiot
01-07-2004, 02:28 AM
COOL...figured it out. I had to remove them both with same rpm -e command!!
justlinux.com
Copyright 2007 Jupitermedia Corporation All Rights Reserved.