Rpm doesn't replace symbolic links during upgrade

Kacper Kornet draenog at pld-linux.org
Fri Apr 19 20:15:18 CEST 2013

I have just encountered an rpm behaviour which is counter intuitive for
me. Let's say that I have a package with one directory and a file in it:

$ rpm -ql test-pkg

Then I remove the dir directory and in its place I create a symbolic
link to another directory:

$ mkdir /tmp/dir2; rm -r /tmp/dir; ln -s /tmp/dir2 /tmp/dir
$ rpm -V test-pkg 
....L...    /tmp/dir
missing     /tmp/dir/a

So far everything is fine. Now I have a trivial upgrade for the package:

$ rpm -qpl test-pkg-1-0.2.i686.rpm 
$ rpm -Uv test-pkg-1-0.2.i686.rpm
Preparing packages for installation...
$ rpm -V test-pkg
....L...    /tmp/dir

Why did rpm preserve the wrong symbolic link during upgrade? I would
expect it to remove it and recreate /tmp/dir as proper directory.

$ rpm -q rpm


More information about the pld-devel-en mailing list