1

This morning, while doing a routine apt update followed by apt full-upgrade of 3 packages (dpkg, dpkg-dev, libdpkg-perl) on my RPi Zero 2W, I received the following message:

dpkg: warning: This system uses merged-usr-via-aliased-dirs, going behind dpkg's
dpkg: warning: back, breaking its core assumptions. This can cause silent file
dpkg: warning: overwrites and disappearances, and its general tools misbehavior.
dpkg: warning: See https://wiki.debian.org/Teams/Dpkg/FAQ#broken-usrmerge.

I've read the linked wiki article, but it makes little sense to me:

Q: Does dpkg support merged-/usr-via-aliased-dirs?

A: No. This approach is considered broken by design and breaks many common expectations.

In dpkg the expected breakage includes:

failing to notice file conflicts with the subsequent silent file overwrites by f.ex. dpkg, dpkg-divert and update-alternatives,
files disappearing during package upgrades or diversion installation,
failing to activate triggers on pathnames,

failing to find pathnames on dpkg-query -S searches,
failing to install packages shipping the same filename in real and aliased directories (with rather cryptic errors), f.ex. to be able to install otherwise dependency satisfiable packages needed by old software,

completely messing up the filesystem by simply using dpkg-deb -x or tar -x. 

If you have a system that has been installed recently (since Debian buster) or switched via the usrmerge hack, you might want to consider using the dpkg-fsys-usrunmess program (but beware that it should not be used in systemd's emergency mode) or reinstalling. For further information see Teams/Dpkg/MergedUsr.

Debian officially only supports merged-/usr-via-aliased-dirs systems. Converting to an unmerged-/usr setup might break the system in unexpected ways in the future, including data loss or failure to boot.

On the surface, this warning appears to contradict itself; i.e. the first line:

Q: Does dpkg support merged-/usr-via-aliased-dirs? Answer: No ...

And then the last line:

Debian officially only supports merged-/usr-via-aliased-dirs systems. Converting to an unmerged-/usr setup might break the system in unexpected ways in the future, including data loss or failure to boot.

Has anyone encountered this before, or understand its meaning?

goldilocks
  • 60,325
  • 17
  • 117
  • 234
Seamus
  • 23,558
  • 5
  • 42
  • 83

1 Answers1

1

If you aren't aware of the history, this is something Fedora did more than a decade ago and other distros have been following suit ever since (there is a parallel in the wider Unix world too, I believe). If you are curious there's probably oodles of pro- and contra- discussion online, IMO the main take away points are:

  1. Historically, the practice was to facilitate systems where the bulk of software would install to the /usr directories, which could be on separate storage which might not be immediately available to the kernel and init system at boot; core things likely to be needed before that would be in the toplevel directories. But the widespread use of initramfs type systems together with the potential for virtual partitions (eg. via RAID) pretty much obsoleted this issue.

  2. While maintaining the practice atavisticly might be fine, over time it is simply a pointless complication with some pitfalls (eg., binaries with the same name in /bin, and /usr/bin are resolved via $PATH, which then hides the problem...).

The apparent contradiction in that Debian doc has do with tensions between the Debian adaption, which is quite recent, and dpkg's implementation, see:

By my reading of this, the dpkg people pushed back by saying they can't do this (partially justified by not wanting to, although I suspect a chicken and egg there) therefore Debian should not, but at this point it has all gone ahead.

I did at some point find a list of the actual issues this causes for dpkg and cannot find it again now, but I would not worry too much; RaspiOS is to whatever extent downstream of Debian (I dunno what the ratio is of packages split between the two repos) and while Bookworm has been in release for almost a full year, AFAIK there hasn't been any disasters -- eg., searching U&L for "Debian usr merge" doesn't reveal any posts on the topic since before bookworm was actually released (maybe interesting from there), further implying most Debian users aren't bothered by it.

goldilocks
  • 60,325
  • 17
  • 117
  • 234