problem with rpm: rename/unlink failed: is a directory

Michal Moskal malekith at pld-linux.org
Fri Oct 18 13:05:49 CEST 2002


[malekith at roke RPMS]$ sudo rpm -Uvh yelp-2.1.0-2.i586.rpm 
Preparing...                ########################################### [100%]
   1:yelp                   ########################################### [100%]
[malekith at roke RPMS]$ ls -l /usr/X11R6/bin/yelp
-rwxr-xr-x    1 root     root        90472 Oct 17 19:02 /usr/X11R6/bin/yelp*
[malekith at roke RPMS]$ sudo rpm -e yelp
[malekith at roke RPMS]$ sudo mkdir /usr/X11R6/bin/yelp
[malekith at roke RPMS]$ sudo rpm -Uvh yelp-2.1.0-2.i586.rpm
Preparing...                ########################################### [100%]
   1:yelp                   ########################################### [100%]
error: unpacking of archive failed on file /usr/X11R6/bin/yelp: cpio: rename failed - Is a directory[malekith at roke RPMS]$ ls -l /usr/X11R6/bin/yelp*         
-rw-r--r--    1 root     root        90472 Oct 18 12:48 /usr/X11R6/bin/yelp;3dafe6f2

/usr/X11R6/bin/yelp:
total 0
[malekith at roke RPMS]$ sudo rpm -e yelp
error: package yelp is not installed

I use rpm-4.1, but the same problem (with s/rename/unlink/ in error
message I guess) occurs in older versions.

The solution would be to (in shell terms) do rm -r <file> before rename,
not just rm <file> as rpm does.

However I'm not sure if that's so good idea. The problem occurs mainly
with some random junk left in filesystem by installation/reinstallation
or manual installation. However there can be also a problem if package
qux places its files in directory /foo/bar, that is symlink to say
/foo/bar-1.1 in foo package, and qux doesn't require qux. Now when
we install foo, when qux is already installed files from qux will go to
/dev/null.

However rpm by default overwrites files, so why shouldn't it overwrite
directories?

-- 
: Michal Moskal ::::: malekith/at/pld-linux.org :  GCS {C,UL}++++$ a? !tv
: PLD Linux ::::::: Wroclaw University, CS Dept :  {E-,w}-- {b++,e}>+++ h



More information about the pld-devel-en mailing list