Latest blog entry

error: unpacking of archive failed on file /usr/bin/xxxx: cpio: open Failed

September 5, 2010    |   Posted by admin   |    Category: Linux Administration

The error message “unpacking of archive failed on file /usr/bin/xxxx: cpio: open Failed” indicates that the system failed to install the rpm since it cannot unpack the package under the /usr/bin directory.

For example, you may see the error message as stated below while installing a ‘nano’ package using yum

Error unpacking rpm package nano-1.x.x.i386 
error: unpacking of archive failed on file /usr/bin/nano;
4c70f874: cpio: open Failed:

This indicates that the file /usr/bin/nano cannot be created under the /usr/bin directory which mostly happens if an attribute is set on the directory.

Use the ‘lsattr’ command to check if an attribute is set on the directory:

# lsattr /usr | grep bin 
----i-----I-- /usr/bin

If the file/directory have an immutable bit (lowercase ‘i’) set as shown in the above output, it indicates that the permissions to write in the file/directory has been denied.

To remove the immutable bit, use the ‘chattr’ command:

# chattr -i /usr/bin 

Once done, you can successfully install the rpm.

Important:

In some cases though, the rpm file itself is corrupt and cannot be installed, so it is also recommended to try install the rpm on another server to see if it works. If it fails on another server too, you should download the package from a different website / mirror.