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 (like root or nobody), or by number if you prepend a # (like #0 or #65534). the mode has to be in octal, bestie, octal. if --update is 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-thing options ๐Ÿซถ

Supported since dpkg 1.19.5.

  • --version โ€” shows the version and exits ๐Ÿ‘‘

๐Ÿ’œ OPTIONS ๐Ÿ’œ

  • --admindir directory โ€” sets the administrative directory to directory. this is where the statoverride file lives. defaults to ยซ/var/lib/dpkgยป if DPKG_ADMINDIR has not been set โœจ
  • --instdir directory โ€” sets the installation directory, aka the directory where packages get installed. defaults to ยซ/ยป if DPKG_ROOT has 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ยป if DPKG_ROOT has 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-help displays 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 --instdir or --root options 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 --admindir or --root options 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 the dpkg --debug option, 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), always and never ๐ŸŒˆ

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: 0 and 1 (default) ๐ŸŒ

Supported since dpkg 1.22.7.

  • DPKG_PATH_PASSWD โ€” sets the pathname for the system passwd file. this path is relative to the --root directory. 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 --root directory. 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 as status or available ๐Ÿ“
๐Ÿ“ Note: dpkg-statoverride preserves 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 ๐Ÿ’ซ

dpkg(1).


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