factor into dpkg and ucf clean_conflicts functionality
clean_conflicts should be sent upstream.
this is not an easy task! it covers two completely different programs (
dpkg) which have both their own logic and run sequence.
ideally, all this would be run at the beginning of the upgrade, just like the debconf templates (which unfortunately are still sometimes prompted during the upgrade).