dpkg-fsys-usrunmess(8)

๐Ÿ“ฆ version 1.21.23, in debian bookworm

๐Ÿ’– dpkg-fsys-usrunmess โ€” a lil' page from the dpkg suite ๐Ÿ’–

okay bestie, sit down, hydrate, and let me tell you about this absolute icon of a tool ๐Ÿ’…

โœจ NAME โœจ

dpkg-fsys-usrunmess โ€” the tool that undoes the merged-/usr-via-aliased-dirs mess ๐Ÿงนโœจ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

dpkg-fsys-usrunmess [option...]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so dpkg-fsys-usrunmess is literally here to fix up filesystems that got installed fresh with recent installers that had, um, unfortunate defaults ๐Ÿ˜ญ, or that got migrated into the broken merged /usr via aliased directories layout โ€” which dpkg does not support, no cap. go read the dpkg FAQ if you wanna know more, iykyk.

Note: in Debian, its tech-ctte has decreed that on the release after bookworm, the non-usrmerged layout is not going to be supported, and so some of its maintainers might not fix issues or might intentionally remove non-usrmerged support. so you're gonna need to decide and pick your poison ๐Ÿ’€ fr fr.

the program does these overall actions, in order, periodt:

  • check whether the system even needs to be switched โ€” otherwise, do nothing ๐Ÿซถ
  • check for dpkg database consistency, and otherwise abort
  • generate and install a regression prevention package, if it was requested on the command-line or otherwise at the prompt
  • get the list of files and alternatives that need to be restored
  • look for untracked kernel modules files that need to be moved too ๐Ÿ‘€
  • create a shadow hierarchy under /.usrunmess, by creating the directories symlinks or hardlinking or copying the files as needed
  • prompt for confirmation before proceeding, if that was requested on the command-line
  • lock the dpkg database ๐Ÿ”’
  • mark all packages as half-configured, to force running maintainer scripts that might need to recreate files
  • replace the aliased directories with the shadow ones, by creating a backup of the old symlinked directories and renaming the shadow ones over
  • relabel MAC information for directories and symlinks if necessary
  • remove backup symlinks
  • remove old moved objects, but defer directory removal
  • remove old deferred directories that are not referenced by dpkg-query
  • remove the shadow root directory
  • register a policy-rc.d to disallow service actions โ€” which means services might need to be restarted afterwards, ideally via a reboot ๐Ÿ”„
  • reconfigure all packages
  • unregister the policy-rc.d and restore the alternatives state
Note: when running the program from some shells such as bash(1) or zsh(1), after executing it you might need to ask the shell to forget all remembered executable locations, with for example hash -r ๐Ÿšโœจ
Note: some directories might linger after the migration in case they contain untracked files. a list gets printed once the script has finished, so you can go investigate ๐Ÿ”
Warning: bestie, this operation has the potential to render the system unusable or broken in case of a sudden crash or reboot, an unexpected state of the system, or possible bugs in the script ๐Ÿ˜ญ be prepared with recovery media and consider doing backups beforehand. like, actually. ๐Ÿ™

๐Ÿ’… OPTIONS ๐Ÿ’…

  • -p, --prompt โ€” prompts you at the time of no return, so you can evaluate the debug output or the shadow hierarchy before proceeding ๐Ÿ‘€
  • --prevention โ€” enables generating and installing a regression prevention package into the system โœจ
  • --no-prevention โ€” disables generating and installing a regression prevention package into the system ๐Ÿšซ

if no option has been specified, the action to take will be prompted. the generated package contains the Protected field set to yes, to protect against accidental removal of the package ๐Ÿ›ก๏ธ

  • -n, --no-act โ€” enables dry-run mode, where no destructive action takes place, only the preparatory part ๐Ÿงช
  • --dry-run โ€” same vibe as above, dry-run mode, only the preparatory part ๐ŸŒˆ
  • -?, --help โ€” shows the usage message and exits ๐Ÿ‘‹
  • --version โ€” shows the version and exits ๐ŸŽ€

๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

  • DPKG_USRUNMESS_NOACT โ€” this setting defines whether to enable dry-run mode ๐ŸŒฑ

๐Ÿซถ SEE ALSO ๐Ÿซถ


and that's the whole page, bestie!! ๐Ÿ’– this one's from the dpkg suite, version 1.21.23, dated 2026-03-07 โ€” go forth and un-mess ur filesystem responsibly, mwah ๐Ÿ’‹๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from