Linux permissions, package management, chattr


A customer emailed in today with a fresh install and was having problems with a basic upgrade.

I tried running a yum update from the Webmin control panel, and got this error for the ‘rpm’ package:

Updating : rpm [ 73/147]Error unpacking rpm package rpm-4.4.2.3-18.el5.i386
error: unpacking of archive failed on file /etc/cron.daily/rpm: cpio: rename

I then logged in and tried to run ‘yum upgrade rpm’ and got the following error as well:

Running Transaction
Updating : rpm 1/2
Error unpacking rpm package rpm-4.4.2.3-18.el5.i386
error: unpacking of archive failed on file /etc/cron.daily/rpm: cpio: rename
Failed:
rpm.i386 0:4.4.2.3-18.el5

I logged in and tried to manually move the file and got the following

[root@black-lotus ~]# mv /etc/cron.daily/rpm /etc/cron.daily/rpm-old
mv: cannot move `/etc/cron.daily/rpm’ to `/etc/cron.daily/rpm-old’: Operation not permitted

So i checked the permissions

[root@black-lotus ~]# ls -l /etc/cron.daily/rpm
-rwxr-xr-x 1 root root 408 Oct 21 17:09 /etc/cron.daily/rpm

Nothing wrong with that, is it set immutable with chattr?

[root@black-lotus ~]# lsattr /etc/cron.daily/rpm
—-i——– /etc/cron.daily/rpm

Yes it is, it was set so its undeleteable. I fixed that with the following

[root@black-lotus ~]# chattr -i /etc/cron.daily/rpm
[root@black-lotus ~]# lsattr /etc/cron.daily/rpm
————- /etc/cron.daily/rpm

Then updated.

[root@black-lotus ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirror.skiplink.com
* base: mirrors.adams.net
* extras: mirrors.combinetworks.com
* updates: www.cyberuse.com
Setting up Update Process
Resolving Dependencies
–> Running transaction check
—> Package rpm.i386 0:4.4.2.3-18.el5 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
Package Arch Version Repository Size
====================================================================================================================================
Updating:
rpm i386 4.4.2.3-18.el5 base 1.2 M

Transaction Summary
====================================================================================================================================
Install 0 Package(s)
Update 1 Package(s)
Remove 0 Package(s)

Total download size: 1.2 M
Is this ok [y/N]: y
Downloading Packages:
rpm-4.4.2.3-18.el5.i386.rpm | 1.2 MB 00:08
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : rpm 1/2
Cleanup : rpm 2/2

Updated:
rpm.i386 0:4.4.2.3-18.el5

Complete!

Problem fixed :)


3 responses to “Linux permissions, package management, chattr”

  1. That customer was me. Thanks again Liz (I just found the KB today). I actually had this issue again today when trying to install man.i386. Glenn fixed it the same way. I’m just curious as to why this would happen on a fresh CentOS 5 VPS like mine?

  2. Heya

    It would be set that way from a poorly packaged package management or if the package management exited uncleanly without finishing the unpacking and setting up processes probably. If you have any problems though, just drop in an email to support.