DH_USRLOCAL(1)
π DH_USRLOCAL(1) π
okay bestie, so this is a page from the Debhelper manual, and it's all about dh_usrlocal β the little icon that migrates your usr/local directories into maintainer scripts. yes queen, let's get into it π
β¨ NAME β¨
dh_usrlocal β migrate usr/local directories to maintainer scripts π¦
πΈ SYNOPSIS πΈ
dh_usrlocal [debhelper options] [-n]
π DESCRIPTION π
So like, dh_usrlocal is a debhelper program you use when you're building packages that are gonna provide a subdirectory inside /usr/local once they're installed. main character behavior, honestly π
Here's the tea: it goes looking through the package build directory for subdirectories of usr/local, and it removes them, swapping them out for maintainer script snippets instead (unless you pass -n, more on that below). Those snippets then create the directories at install time and remove them when the package gets removed β all done in a manner that's compliant with Debian policy. periodt. β¨
Those snippets get inserted into the maintainer scripts by dh_installdeb. If you want the whole explanation of what debhelper maintainer script snippets even are, go check out dh_installdeb(1). π
Now, concerning the DEB_RULES_REQUIRES_ROOT environment variable, because she's important:
- When
DEB_RULES_REQUIRES_ROOTis not (effectively)binary-targets, the directories in/usr/localget handled as if they were owned by <code>root:root</code> (see below, bestie π). - When
DEB_RULES_REQUIRES_ROOThas an effective value ofbinary-targets, the owners, groups and permissions will be preserved β with the sole exception of where the directory is owned byroot:root.
And if a directory is owned by root:root? Then ownership gets determined at install time. The ownership and permission bits will either be root:root mode 0755 or root:staff mode 02775. Which one you get depends on whether the system has /etc/staff-group-for-usr-local β as documented in the Debian Policy Manual Β§9.1.2 since version 4.1.4. no cap π
π OPTIONS π
-n,--no-scriptsβ Do not modifypostinst/prermscripts. she simply does not touch them π
β οΈ NOTES β οΈ
Heads up bestie, this command is not idempotent. π
dh_prep(1) should be called between invocations of this command. Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. not the duplicate snippets era π
π CONFORMS TO π
Debian policy, version 2.2 π¦
π₯ SEE ALSO π₯
This program is a part of debhelper. π«Ά
π AUTHOR π
Andrew Stribblehill <ads@debian.org> π
and that's the whole page, bestie!! this was dh_usrlocal from debhelper version 14.5ubuntu1, dated 2026-09-21. go forth and migrate those usr/local dirs responsibly, mwah πβ¨π
π¦ where this page comes from
- ubuntu stonking: debhelper 14.5ubuntu1 Β· 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