Comment 1 for bug 164228

Revision history for this message
Colin Watson (cjwatson) wrote :

This is (I am reliably informed) intentional behaviour in order to avoid potentially-confusing semantics. Multiple packages can own a given directory (and frequently do, e.g. /usr), and this is to prevent confusion when only one of them decides to turn it into a symlink. (Consider that one of the other packages that owns the directory might be installed later.) There are conceivably ways to work around this, but dpkg has chosen not to attempt it for simplicity and in order to force maintainers to consider this.

The standard workaround is to include a preinst that, on upgrade to the version in which you make this change, 'rm -rf's the directory; the link will then be created on unpack. Alternatively, if there might be non-dpkg-managed files in that directory, you should move it aside to a safe place in the preinst, and then move those files into the target of the symlink in the postinst.