[TriLUG] Removing unused Kernel rpms

Glenn Meyer me at glennmeyer.com
Thu Apr 3 16:53:30 EST 2003


I have a Red Hat 7.1 system that has gone through a number of updates 
(using up2date) over the past couple years.  I see that my /boot dir is 
about to fill up.  I would like to free up some of that space by 
removing the oldest and unused kernels.

I tried doing so using RPM, but I have never been able to get RPM to 
uninstall anything on this box (RPM and Up2Date have also been upgraded 
through the years - install work fine, but every -e I try to run gives 
me the same "package is not installed" error you'll see below.  Is there 
a way to fix RPM?  I have tried rebuilding the database, but no help.

As an alternative, is there any reason I can't simply rm the files 
associated with the oldest kernels (dir listing below), like
rm *2.4.2*
rm *2.4.9*
rm *2.4.18-17*

Thank you for your help!!!


[root at main /root]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda8            1011M  295M  665M  31% /
/dev/hda1              30M   26M  3.1M  90% /boot
/dev/hda5             4.7G  2.6G  1.8G  58% /home
/dev/hda6             2.0G  1.4G  525M  73% /usr
/dev/hda7            1011M  113M  847M  12% /usr/local
/dev/hda9             509M   63M  421M  13% /var
none                  188M     0  187M   0% /dev/shm

[root at main /root]# rpm -qa | grep kernel
kernel-2.4.2-2
kernel-2.4.9-12
kernel-2.4.18-18.7.x
kernel-2.4.18-27.7.x
kernel-2.4.18-17.7.x
kernel-headers-2.4.9-34
kernel-2.4.18-24.7.x
kernel-2.4.9-34
kernel-source-2.4.18-27.7.x

[root at main /root]# rpm -e kernel-2.4.9-2
error: package kernel-2.4.9-2 is not installed

[root at main /boot]# ll
total 26296
-rw-r--r--    1 root     root          512 Jan 22  2002 boot.0300
-rw-r--r--    1 root     root         5824 Feb 23  2001 boot.b
-rw-r--r--    1 root     root          612 Feb 23  2001 chain.b
-rw-r--r--    1 root     root        42268 Oct  8 12:47 config-2.4.18-17.7.x
-rw-r--r--    1 root     root        42268 Nov 13 19:50 config-2.4.18-18.7.x
-rw-r--r--    1 root     root        42257 Jan 31 06:20 config-2.4.18-24.7.x
-rw-r--r--    1 root     root        42257 Mar 14 05:56 config-2.4.18-27.7.x
-rw-r--r--    1 root     root       179935 Oct 18 21:53 
initrd-2.4.18-17.7.x.img
-rw-r--r--    1 root     root       185896 Dec  3 14:25 
initrd-2.4.18-18.7.x.img
-rw-r--r--    1 root     root       180089 Mar  3 18:10 
initrd-2.4.18-24.7.x.img
-rw-r--r--    1 root     root       185872 Mar 26 15:08 
initrd-2.4.18-27.7.x.img
-rw-r--r--    1 root     root       368358 Jan 22  2002 initrd-2.4.2-2.img
-rw-r--r--    1 root     root       376393 Jan 22  2002 initrd-2.4.9-12.img
-rw-r--r--    1 root     root       391856 Jun 25  2002 initrd-2.4.9-34.img
lrwxrwxrwx    1 root     root           14 Jun 25  2002 kernel.h -> 
kernel.h-2.4.9
-rw-r--r--    1 root     root          405 Jun 25  2002 kernel.h-2.4.9
drwxr-xr-x    2 root     root        12288 Jan 22  2002 lost+found
-rw-------    1 root     root       101376 Mar 26 15:10 map
-rw-r--r--    1 root     root        23108 Feb 23  2001 message
lrwxrwxrwx    1 root     root           25 Mar 26 15:08 module-info -> 
module-in
fo-2.4.18-27.7.x
-rw-r--r--    1 root     root        15436 Oct  8 12:47 
module-info-2.4.18-17.7.x
-rw-r--r--    1 root     root        15436 Nov 13 19:50 
module-info-2.4.18-18.7.x
-rw-r--r--    1 root     root        15436 Jan 31 06:20 
module-info-2.4.18-24.7.x
-rw-r--r--    1 root     root        15436 Mar 14 05:56 
module-info-2.4.18-27.7.x
-rw-r--r--    1 root     root        13598 Apr  8  2001 module-info-2.4.2-2
-rw-r--r--    1 root     root        13598 Oct 30  2001 module-info-2.4.9-12
-rw-r--r--    1 root     root        13599 Jun  1  2002 module-info-2.4.9-34
-rw-r--r--    1 root     root          640 Feb 23  2001 os2_d.b
lrwxrwxrwx    1 root     root           24 Mar 26 15:08 System.map -> 
System.map-2.4.18-27.7.x
-rw-r--r--    1 root     root       490222 Oct  8 12:47 
System.map-2.4.18-17.7.x
-rw-r--r--    1 root     root       490460 Nov 13 19:50 
System.map-2.4.18-18.7.x
-rw-r--r--    1 root     root       490643 Jan 31 06:20 
System.map-2.4.18-24.7.x
-rw-r--r--    1 root     root       490673 Mar 14 05:56 
System.map-2.4.18-27.7.x
-rw-r--r--    1 root     root       410990 Apr  8  2001 System.map-2.4.2-2
-rw-r--r--    1 root     root       438077 Oct 30  2001 System.map-2.4.9-12
-rw-r--r--    1 root     root       438900 Jun  1  2002 System.map-2.4.9-34
-rwxr-xr-x    1 root     root      2983642 Oct  8 12:47 
vmlinux-2.4.18-17.7.x
-rwxr-xr-x    1 root     root      2983920 Nov 13 19:50 
vmlinux-2.4.18-18.7.x
-rwxr-xr-x    1 root     root      2986554 Jan 31 06:20 
vmlinux-2.4.18-24.7.x
-rwxr-xr-x    1 root     root      2986589 Mar 14 05:56 
vmlinux-2.4.18-27.7.x
-rwxr-xr-x    1 root     root      2280836 Apr  8  2001 vmlinux-2.4.2-2
lrwxrwxrwx    1 root     root           21 Mar 26 15:08 vmlinuz -> 
vmlinuz-2.4.18-27.7.x
-rw-r--r--    1 root     root      1064846 Oct  8 12:47 
vmlinuz-2.4.18-17.7.x
-rw-r--r--    1 root     root      1064284 Nov 13 19:50 
vmlinuz-2.4.18-18.7.x
-rw-r--r--    1 root     root      1064546 Jan 31 06:20 
vmlinuz-2.4.18-24.7.x
-rw-r--r--    1 root     root      1065261 Mar 14 05:56 
vmlinuz-2.4.18-27.7.x
-rw-r--r--    1 root     root       781806 Apr  8  2001 vmlinuz-2.4.2-2
-rw-r--r--    1 root     root       980299 Oct 30  2001 vmlinuz-2.4.9-12
-rw-r--r--    1 root     root       976110 Jun  1  2002 vmlinuz-2.4.9-34


[root at main /boot]# ll *2.4.2*
-rw-r--r--    1 root     root       368358 Jan 22  2002 initrd-2.4.2-2.img
-rw-r--r--    1 root     root        13598 Apr  8  2001 module-info-2.4.2-2
-rw-r--r--    1 root     root       410990 Apr  8  2001 System.map-2.4.2-2
-rwxr-xr-x    1 root     root      2280836 Apr  8  2001 vmlinux-2.4.2-2
-rw-r--r--    1 root     root       781806 Apr  8  2001 vmlinuz-2.4.2-2


[root at main /boot]# ll *2.4.9*
-rw-r--r--    1 root     root       376393 Jan 22  2002 initrd-2.4.9-12.img
-rw-r--r--    1 root     root       391856 Jun 25  2002 initrd-2.4.9-34.img
-rw-r--r--    1 root     root          405 Jun 25  2002 kernel.h-2.4.9
-rw-r--r--    1 root     root        13598 Oct 30  2001 module-info-2.4.9-12
-rw-r--r--    1 root     root        13599 Jun  1  2002 module-info-2.4.9-34
-rw-r--r--    1 root     root       438077 Oct 30  2001 System.map-2.4.9-12
-rw-r--r--    1 root     root       438900 Jun  1  2002 System.map-2.4.9-34
-rw-r--r--    1 root     root       980299 Oct 30  2001 vmlinuz-2.4.9-12
-rw-r--r--    1 root     root       976110 Jun  1  2002 vmlinuz-2.4.9-34






More information about the TriLUG mailing list