Complete the merged-/usr transition
The problem
Debian has embarked on a transition to merged /usr, meaning that /bin is a symlink to /usr/bin, /lib is a symlink to /usr/lib, and so forth. This matches the layout of other Linux distributions and eliminates a bit of complexity (deciding what should be in /bin vs. /usr/bin) that is no longer particularly useful. However, that transition is not complete.
Half-finished transitions are a particularly nasty form of technical debt. They're a mental tax on everyone affected by the transition. We should resolve this transition in one direction or another, either by rolling back merged /usr on all systems or by merging /usr on all systems.
My understanding is that the project currently has decided to do the latter but not adopted a technical plan for how to do so.
Actual situation
dpkg has no knowledge of merged /usr and therefore does not understand that a package that installs a file in /bin and another package that installs a file of the same name in /usr/bin are in fact installing the same file. This can cause serious problems in various edge cases.
Merged /usr is implemented via a package that performs file system manipulations in its postinst but does not canonicalize dpkg's understanding of the file system.
Debian is supposed to complete this transition in the current release cycle, but we're not entirely comfortable with the existing solution and know of edge cases that are difficult to fix using the current setup.
Expected situation
Below is a sketch of how to move forward. I believe I can see the steps required and believe they are all technically possible. It would also be possible to resolve the transition by unmerging /usr on all systems, but I don't see how to do this without breaking user software that has now hard-coded paths in /usr that in an unmerged system would be in /bin or /lib.
This description therefore focuses on the path to merging /usr. If someone has an equally fleshed-out proposal for undoing the merge, I would be interested in seeing it.
dpkg should be aware of the aliases and able to canonicalize its own database representation of installed file system paths so that there is no confusion about files installed in /bin vs. /usr/bin (and likewise for the other affected paths).
As discussed on debian-devel, there are a few challenging corner cases to work through, particularly around bootstrapping a new system. A lot of work has gone into making it possible to bootstrap Debian purely by installing packages, without having to take special file system actions outside of package installation, but it's not clear how that interacts with a merged /usr world and specifically who will create the merged /usr symlinks and then tell dpkg that they exist.
The amount of code required seems unlikely to be large once we've identified the correct place to put that code, but the design is tricky and will require a lot of testing.