dpkg-fsys-usrunmess(8)
๐ 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
dpkgdatabase 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
dpkgdatabase ๐ - 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.dto disallow service actions โ which means services might need to be restarted afterwards, ideally via a reboot ๐ - reconfigure all packages
- unregister the
policy-rc.dand restore the alternatives state
Note: when running the program from some shells such asbash(1)orzsh(1), after executing it you might need to ask the shell to forget all remembered executable locations, with for examplehash -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
- debian bookworm: dpkg 1.21.23 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms