Add xz-lzma back, using update-alternatives
With update-alternatives, xz-lzma and lzma can be installed at
the same time, and switching between them in the presence of
dpkg’s lzma pre-dependency is no longer a problem.
xz-lzma is considered a “worse” alternative than lzma to provide
the lzma, unlzma, and lzcat commands, since if a user has the
lzma package installed, it is for the sake of those commands.
Consider what happens when installing xz-lzma with lzma already
installed:
1. “dpkg --unpack xz-utils” makes the xz command available in
/usr/bin. The lzmp binary and lzma symlink from the lzma
package are untouched.
2. “dpkg --install libc6” upgrades libc to satisfy xz-lzma’s
pre-dependency.
3. “dpkg --unpack xz-lzma” makes various lzma-related commands
available in /usr/bin, but the lzma symlink is untouched.
4. “dpkg --configure xz-utils” does nothing of interest.
5. “dpkg --configure xz-lzma” adds alternatives for the lzma,
unlzma, and lzcat commands, but since the lzma package provides
better alternatives, the lzma symlink is still untouched.
Afterwards, if the lzma package is deconfigured or removed, the
lzma symlink changes to point to /usr/bin/xz. At no point is
/usr/bin/lzma missing or pointing nowhere; dpkg’s pre-dependency
is satisfied.
Thanks to adn for the idea.