A trivially conflicting package foo can be made to work with bar, by running dpkg --force-conflicts -i foo
. But eventually it's time to upgrade, and 'apt-get' objects:
% apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
foo : Conflicts: bar but 0.2-1 is installed
E: Unmet dependencies. Try using -f.
Can apt-get be tweaked/forced to tolerate the (pretty much fixed) conflict, then upgrade?
(Quickie existence proof: uninstall foo, then upgrade, then reinstall foo as before. Therefore it is possible, the question is finding the least cumbersome mechanism.)
An example, but this question is not about any two particular packages.
For several years GNU parallel has had a trivial conflict with moretutils; each provides /usr/bin/parallel. dpkg can force co-existence:
# assume 'moreutils' is already installed, and 'parallel' is in
# apt's cache directory.
dpkg --force-conflicts -i /var/cache/apt/archives/parallel_20141022+ds1-1_all.deb
This creates a diversion, renames the moreutils version to /usr/bin/parallel.moreutils. Both programs work, until the user upgrades.
I tried an -o option, but that didn't bring on peace:
apt-get -o Dpkg::Options::="--force-conflicts" install parallel moreutils
Possible -o options number in the hundreds, however…
Best Answer
Since OP asked for a list of commands (with which to change the relevant metadata of the package) in the comments to Gilles' answer, here it is:
This is under the assumptions that the conflicts line only has
moreutils
as an entry (and without version restrictions) as was the case in my installation. Otherwise, use'/^Conflicts:/s/\(, \)\?moreutils\( [^,]\+\)\?//'
as the secondsed
script to only remove the relevant part of the line and support version restrictions.Your installed package won't be overwritten by newer versions from the repository and you have to manually repeat this procedure for every update to the GNU parallel package if you want to keep this package up-to-date.