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

Re: Bug#542060: Replacing an essential package

Eugene V. Lyubimkin wrote:
> Jonathan Nieder wrote:

>> What I meant to achieve is accomplished with Replaces/Provides without
>> the Conflicts. Once xz-utils has written over all the files of lzma,
>> lzma would be marked as uninstalled, so normally the two packages
>> would not be installed at once.
>> But how to ensure all the files of lzma are overwritten, when newer
>> versions could always add more files?
> Seems slightly ugly, but 'Breaks: lzma' may help.

I agree, so I won't be using ‘Breaks:’.

The more I think about it, the more my solution seems not to be a
solution at all. Although xz-utils includes the same files as lzma
outside of /usr/share/doc, it would make no sense for xz-utils to
include /usr/share/doc/lzma/copyright. Marking xz-utils ‘Replaces:
lzma’ allows for a smooth install but does not ensure lzma is

Worse still, if one forgets to uninstall lzma and then uninstalls
xz-utils, dpkg will think its dependency on lzma is still satisfied.
The result is a broken installation.

The only sane way to replace a (pseudo-)essential package seems to be
the way Sven Joachim indicated, which uses an upgrade of the replaced
package to make the scenario in the last paragraph impossible. I don’t
want to force XZ Utils on anyone, so I am not inclined to do that.

Even making xz-lzma divert /usr/bin/lzma leaves a window of time when
there is no /usr/bin/lzma installed.

The way forward:

1. Split xz-utils into xz-utils and xz-lzma packages. Users can
install xz-utils without encountering all this mess (already done a
while ago). Since xz-lzma Provides/Replaces/Conflicts lzma, it cannot
be installed, so do not ship it yet.

2. Patch dpkg to use the “xz” command if available. Change its
Pre-Depends: to lzma | xz-utils.

3. Start shipping the xz-lzma package, installable at last.

It would have been nice to allow xz-lzma and lzma as alternative ways
to satisfy dpkg’s dependency without modifying dpkg, but I can’t see
any way to do that.

Thanks again for all the help,

Reply to: