Centos Update error: unpacking of archive failed on file /var/mail: cpio: rename

Running the install package to upgrade CentOs in virtualmin gives the following unpacking error so it won't install.

Now updating filesystem .. Installing package(s) with command yum -y install filesystem .. Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile * base: ftp.plusline.de * centosplus: ftp.plusline.de * extras: ftp.plusline.de * updates: ftp.plusline.de Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package filesystem.x86_64 0:2.4.0-3.el5.centos set to be updated --> Finished Dependency Resolution

Dependencies Resolved

================================================================================

Package Arch Version Repository Size

Updating: filesystem x86_64 2.4.0-3.el5.centos base 1.0 M

Transaction Summary

Install 0 Package(s) Upgrade 1 Package(s)

Total download size: 1.0 M Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Updating : filesystem 1/2Error unpacking rpm package filesystem-2.4.0-3.el5.centos.x86_64

error: unpacking of archive failed on file /var/mail: cpio: rename

Failed: filesystem.x86_64 0:2.4.0-3.el5.centos

Complete! .. install failed!

No packages were installed. Check the messages above for the cause of the error.

Any help greatly appreciated.

Many thanks

Pete...

Status: 
Active

Comments

Howdy -- what output do you receive if you run these two commands:

df -h
ls -ld /var/mail

Hi Andrey

Plenty of disc space 620GB Free

df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 899G 233G 620G 28% / tmpfs 5.9G 0 5.9G 0% /dev/shm

ls -ld /var/mail drwxr-xr-x 3 root root 12288 Aug 16 16:32 /var/mail

does that shed any more light on the problem..?

Many thanks for your help.

Pete...

Hmm, I don't see anything unusual there.

What if you log in over SSH as root, and run this command:

yum update

Are you able to perform the update from the command line?

This is from the webmin command shell...

yum update Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile * base: ftp.plusline.de * centosplus: ftp.plusline.de * extras: ftp.plusline.de * updates: ftp.plusline.de Skipping security plugin, no data Setting up Update Process Resolving Dependencies Skipping security plugin, no data --> Running transaction check ---> Package filesystem.x86_64 0:2.4.0-3.el5.centos set to be updated --> Finished Dependency Resolution

Dependencies Resolved

================================================================================

Package Arch Version Repository Size

Updating: filesystem x86_64 2.4.0-3.el5.centos base 1.0 M

Transaction Summary

Install 0 Package(s) Upgrade 1 Package(s)

Total download size: 1.0 M Is this ok [y/N]: Exiting on user Command Complete!

You'll need to enter a "y" at the prompt there, which you can't do from the command shell... are you by chance able to use something like Putty to access the command line over SSH?

SSH via Putty same error message...

Transaction Test Succeeded Running Transaction Updating : filesystem 1/2 Error unpacking rpm package filesystem-2.4.0-3.el5.centos.x86_64 error: unpacking of archive failed on file /var/mail: cpio: rename

Failed: filesystem.x86_64 0:2.4.0-3.el5.centos

Complete! [root@ethoshub ~]#

If it helps shed any more light on the problem I now seem to have a series of spurious simbolic links in the /var directory that have appeared directly below the mail folder - see attached screenshot...

Many thanks

Pete...

Hmm, that's all fairly unusual...

What output do you receive if you run this command:

dmesg | tail -30

That will show if there any any kernel errors that have been reported.

Any ideas how this problem can be resolved..?

Very many thanks

Pete...

Does the /var/mail directory contain anything on your system? If not, can you delete and re-create it with :

rmdir /var/mail
mkdir /var/mail

Hi Jamie

Yes, it's got all my mail in it! :)

But following along your same train of thought I renamed it mail_temp and created a new mail directory.

I tried again and got the same error.

I then deleted the new mail directory I'd just created and ran it again and it worked fine!!! :)

Running Transaction Updating : filesystem 1/2 Cleanup : filesystem 2/2

Updated:

Complete! .. install complete.

Successfully installed 1 packages.

So I then renamed mail_temp back to mail and hopefully everything will still be working normally.

Very strange but at least we have one solution now.

All the very best

Pete...

Hmm, it shouldn't actually be using /var/mail for email -- in theory that would be going to the Maildir directories within /home.

I agree with you though, that's all very odd!

What output do you receive if you run these two commands:

echo foo > /var/mail/bar
cat /var/mail/bar

That's just a quick test to verify that the filesystem is working, that second command should display the text "foo".

Yes, that seems to work...

echo foo > /var/mail/bar cat /var/mail/bar foo

But /var/mail is now listed as a symbolic link to /var/spool/ whereas before it was listed as a folder.

Very strange... At least we solved the original problem and this one is probably left well alone now! :)

Many thanks for your help...

Pete...

Ok, that explains it - usually /var/mail is a link to /var/spool/mail , but on your system it was a directory. That's why the filesystem package update failed.

Okay, great... glad we got to the bottom of that one.

Many thanks again for your help.

All the best

Pete...