dpkg-statoverride(1)
๐ dpkg-statoverride(1) โ the dpkg suite's own stat-override queen ๐
okay so bestie, welcome to the dpkg-statoverride page from the dpkg suite, and no cap this one is a little gem. let me tell you everything ๐
โจ NAME โจ
dpkg-statoverride โ override ownership and mode of files ๐ซถ
๐ธ SYNOPSIS ๐ธ
dpkg-statoverride [option...] command
๐ฆ DESCRIPTION ๐ฆ
so "stat overrides" are literally a way to tell dpkg(1) "hey, when you install this path, use a different owner or mode than the package says," and yes that applies to any filesystem object dpkg handles โ directories, devices, all of it ๐ . the classic glow-up use case? forcing programs that are normally setuid to install without the setuid flag, or making them only executable by a certain group. iconic.
dpkg-statoverride is the utility that manages that list of stat overrides. it has three basic functions: adding, removing, and listing overrides. three little jobs, all slay โจ
๐ COMMANDS ๐
--add user group mode pathโ adds an override for path. and here's the cute part: path doesn't even need to exist, and dpkg doesn't need to know about it yet โ the override just gets stored and used later ๐. users and groups can be given by name (likerootornobody), or by number if you prepend a#(like#0or#65534). the mode has to be in octal, bestie, octal. if--updateis also specified and path exists, it's immediately set to the new owner and mode ๐ฅ--remove pathโ removes the override for path. but heads up: the status of path is left unchanged by this command, so it's not undoing anything, just deleting the override ๐--list [glob-pattern]โ lists all overrides. if you pass a glob pattern, it restricts the output to only the overrides that match the glob ๐ซ--helpโ shows the usage message and exits. classic.--force-helpโ gives you help about the--force-thingoptions ๐ซถ
Supported since dpkg 1.19.5.
--versionโ shows the version and exits ๐
๐ OPTIONS ๐
--admindir directoryโ sets the administrative directory to directory. this is where thestatoverridefile lives. defaults to ยซ/var/lib/dpkgยป ifDPKG_ADMINDIRhas not been set โจ--instdir directoryโ sets the installation directory, aka the directory where packages get installed. defaults to ยซ/ยป ifDPKG_ROOThas not been set ๐ธ
Supported since dpkg 1.19.2.
--root directoryโ sets the root directory to directory, which sets the installation directory to ยซ*directory*ยป and the administrative directory to ยซ*directory*/var/lib/dpkgยป ifDPKG_ROOThas not been set ๐ฆ
Supported since dpkg 1.19.2.
--force-things--no-force-things,--refuse-thingsโ force or refuse (no-force and refuse mean the same thing, iykyk) to do some things. things is a comma separated list of the things below.--force-helpdisplays a message describing them. things marked with (*) are forced by default โญ
Supported since dpkg 1.19.5.
โ ๏ธ Warning: these options are mostly intended to be used by experts only. using them without fully understanding their effects may break your whole system. like, literally your whole system ๐
allโ turns on (or off) all force options.statoverride-addโ overwrite an existing stat override when adding it.
Supported since dpkg 1.19.5.
statoverride-removeโ ignore a missing stat override when removing it.
Supported since dpkg 1.19.5.
security-mac(*)โ use platform-specific Mandatory Access Controls (MAC) based security when installing files into the filesystem. on Linux systems the implementation uses SELinux ๐ฅ
Supported since dpkg 1.19.5.
not-rootโ try to (de)install things even when not root ๐
Supported since dpkg 1.21.8.
--forceโ force an action, even if a sanity check would otherwise prohibit it. this is necessary to override an existing override ๐
Deprecated since dpkg 1.19.5, replaced by --force-all.
--updateโ immediately try to change the path to the new owner and mode if it exists โจ--quietโ be less verbose about what we do. shhh ๐คซ
๐ EXIT STATUS ๐
0โ the requested action was successfully performed. we love a win ๐1โ for--list, if there are no overrides or none match the supplied glob ๐ญ2โ fatal or unrecoverable error due to invalid command-line usage, or interactions with the system, such as accesses to the database, memory allocations, etc. ๐
๐ง ENVIRONMENT ๐ง
DPKG_ROOTโ if set and the--instdiror--rootoptions have not been specified, it will be used as the filesystem root directory ๐ฆ
Supported since dpkg 1.19.2.
DPKG_ADMINDIRโ if set and the--admindiror--rootoptions have not been specified, it will be used as the dpkg data directory โจDPKG_DEBUGโ sets the debug mask from an octal value. the currently accepted flags are described in thedpkg --debugoption, but not all these flags might have an effect on this program ๐
Supported since dpkg 1.21.10.
DPKG_FORCEโ if set and none of the--force-...options have been specified, it will be used as the force options to use ๐
Supported since dpkg 1.19.5.
DPKG_COLORSโ sets the color mode. the currently accepted values are:auto(default),alwaysandnever๐
Supported since dpkg 1.18.5.
DPKG_NLSโ if set, it will be used to decide whether to activate Native Language Support, also known as internationalization (or i18n) support. the accepted values are:0and1(default) ๐
Supported since dpkg 1.22.7.
DPKG_PATH_PASSWDโ sets the pathname for the system passwd file. this path is relative to the--rootdirectory. the default is/etc/passwd๐
Supported since dpkg 1.22.16.
DPKG_PATH_GROUPโ sets the pathname for the system group file. this path is relative to the--rootdirectory. the default is/etc/group๐
Supported since dpkg 1.22.16.
๐ FILES ๐
/var/lib/dpkg/statoverrideโ the file which contains the current list of stat overrides of the system. it lives in the dpkg administration directory, along with the other files important to dpkg, such asstatusoravailable๐
๐ Note:dpkg-statoverridepreserves the old copy of this file, with extension โ-oldโ, before replacing it with the new one. so your old one is safe, bestie ๐ซถ
๐ซ SEE ALSO ๐ซ
okay that's the whole page, you ate that ๐ and just so you know where this came from: 1.23.11-dirty, dated 2026-09-09. go forth and override your stats, bestie ๐โจ
๐ฆ where this page comes from
- arch rolling: dpkg 1.23.11-1 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms