This topic explains how to resolve the "error: unpacking of archive failed on file /usr/bin/xxxx: cpio: open Failed" error, which occurs when yum commands like yum -y install XXX, yum list, or yum search XXX fail on a Linux ECS instance.
Problem description
On a Linux ECS instance, yum commands such as yum -y install XXX, yum list, and yum search XXX fail with the following error: error: unpacking of archive failed on file /usr/bin/xxxx: cpio: open Failed.
Cause
This issue occurs when the /usr/bin directory has incorrect file attributes. For example, setting the i or a attribute prevents data from being modified or deleted, which in turn causes yum installation commands to fail.
The following table describes common file attributes.
Attribute | Description |
i | When set on a file, the i attribute prevents the file from being deleted or renamed. Data cannot be added to or modified in the file. When set on a directory, you can modify data in existing files, but you cannot create new files or delete existing ones.
|
a | When set on a file, the a attribute allows data to be appended to the file but prevents the existing data from being deleted or modified. When set on a directory, you can create and modify files, but you cannot delete them.
|
u | When a file or directory with the u attribute is deleted, its contents are saved to enable future recovery. This is typically used to prevent accidental deletion. |
s | When a file or directory with the s attribute is deleted, it is permanently deleted and becomes unrecoverable. |
e | Most files in Linux have the e attribute by default, which indicates that the file is stored using an ext file system. |
Solution
Follow these steps to modify the file attributes of the /usr/bin directory and resolve the yum command failure.
Connect to your ECS instance as the root user.
For more information, see Connection methods overview.
Run the following command to check the attributes of the /usr directory.
lsattr /usr
If the output matches the following, it indicates that the /usr/bin directory has the i attribute, which prevents file creation or deletion within it. Proceed to step 3 to remove this attribute.

Run the following command to remove the i attribute from the /usr/bin directory.
chattr -i /usr/bin
Note +: Adds an attribute to a file or directory.
-: Removes an attribute from a file or directory.
=: Sets a specific attribute for a file or directory.
Run the yum command again to confirm that it works as expected.