Yum Errors - Remove Old Kernels

How to Get Rid of yum Errors by Removing Old Kernels

Occasionally, I have encountered a yum unpacking error when trying to install a new kernel on my Fedora computer:

Running Transaction error: unpacking of archive failed on file /boot/System.map-2.6.16-1.2111_FC5; 44730661: cpio: write

This error can occur when the /boot partition gets too full.

Solution

  1. Open a root shell.
  2. Check which kernels are installed on your computer:
    rpm -qa | grep kernel
    kernel-2.6.16-1.2122_FC5
    kernel-2.6.16-1.2111_FC5
    kernel-2.6.16-1.2080_FC5
    kernel-2.6.16-1.2133_FC5
    kernel-2.6.17-1.2139_FC5
    kernel-2.6.16-1.2096_FC5
  1. Check which kernel you are currently running:
uname -a
Linux mycomputer.mynetwork 2.6.17-1.2139_FC5 #1 Fri Jun 23 12:40:16 EDT 2006 i686 i686 i386 GNU/Linux
  1. Remove all unused kernels, for example all 2.6.16-* kernels:
yum remove kernel-2.6.16-*
  1. I prefer to use yum instead of rpm to remove packages because for me it's much easier to remember how to remove multiple packages with yum.

feeds