[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Overwriting files from other packages will require Replaces



This is just a warning that, following a thin but positive reception
of my proposal a month or so ago, the next version of dpkg will
require a Replaces field if you wish to overwrite files from one
package with another.  See below for exact details.

Ie, if you have A installed containing /usr/bin/spong, and then you
try to install B which also has a /usr/bin/spong, dpkg will bomb out
with an error.

What exactly should be done about this problem will vary from
situation to situation.

If B is an ordinary (nonessential) package which supersedes A then B
should declare both `Replaces: A' and `Conflicts: A' in its control
file.  This will ensure that both dpkg and dselect will remove A when
they come to install B.

If B is providing a `better' version of a file which is also present
in A then the new diversions mechanism should be used.

If A and B are both current packages containing the same file and are
simply fighting over it then they should Conflict with each other;
alternatively their maintainers should come to some amicable
arrangement (for example, by having each httpd package maintainer
rename their /usr/sbin/in.httpd to contain their package name).

If A and B are providing different versions of the same thing, where
users and/or sysadmins may wish to have both installed and still
access one or other by some canonical name then update-alternatives
should be used.

Packages which wish to make use of the special base package
replacement-in-place mechanism, where A is an old base package which
needs to be partially overwritten, should say `Replaces: A' in B's
control file.  This will allow the overwriting to go ahead, and will
make the file be `owned' by B afterwards.

The Replaces field has the same syntax as Conflicts: ie, a list of
packages separated by commas, each with an optional version number.
Virtual package names provided by other packages will not be
considered when looking in Replaces fields - only real package names
should be put in Replaces.

I expect that when this version is released several packages will turn
out to stamp on each others' files without having done any of the
above.  These bugs will need to be fixed before we can release the
result, obviously (or the bad packages withdrawn).

There is no change to the behaviour when dpkg is asked to install a
file that it didn't put there - it will still just overwrite it.

Ian.


Reply to: