# dpkg-statoverride(1) - man - phpman

[dpkg-statoverride(1)](https://www.chedong.com/phpMan.php/man/dpkg-statoverride/1/markdown)                         dpkg suite                         [dpkg-statoverride(1)](https://www.chedong.com/phpMan.php/man/dpkg-statoverride/1/markdown)



## NAME
       dpkg-statoverride - override ownership and mode of files

## SYNOPSIS
       **dpkg-statoverride** [_option_...] _command_

## DESCRIPTION
       “**stat** **overrides**” are a way to tell [**dpkg**(1)](https://www.chedong.com/phpMan.php/man/dpkg/1/markdown) to use a different owner or mode for a path when a
       package is installed (this applies to any filesystem object that **dpkg** handles, including
       directories, devices, etc.). This can be used to force programs that are normally setuid to
       be install without a setuid flag, or only executable by a certain group.

       **dpkg-statoverride** is a utility to manage the list of stat overrides. It has three basic
       functions: adding, removing and listing overrides.

## COMMANDS
       **--add** _user_ _group_ _mode_ _path_
           Add an override for _path_. _path_ does not need to exist when this command is used; the
           override will be stored and used later.  Users and groups can be specified by their name
           (for example **root** or **nobody**), or by their number by prepending the number with a ‘**#**’ (for
           example **#0** or **#65534**).  The _mode_ needs to be specified in octal.

           If **--update** is specified and _path_ exists, it is immediately set to the new owner and
           mode.

       **--remove** _path_
           Remove an override for _path_, the status of _path_ is left unchanged by this command.

       **--list** [_glob-pattern_]
           List all overrides. If a glob pattern is specified restrict the output to overrides which
           match the glob.

### --help
           Show the usage message and exit.

### --force-help
           Give help about the **--force-**_thing_ options (since dpkg 1.19.5).

### --version
           Show the version and exit.

## OPTIONS
       **--admindir** _directory_
           Set the administrative directory to _directory_.  This is where the _statoverride_ file is
           stored.  Defaults to «_/var/lib/dpkg_».

       **--instdir** _directory_
           Set the installation directory, which refers to the directory where packages get
           installed (since dpkg 1.19.2).  Defaults to «_/_».

       **--root** _directory_
           Set the root directory to **directory**, which sets the installation directory to «_directory_»
           and the administrative directory to «_directory_**/var/lib/dpkg**» (since dpkg 1.19.2).

       **--force-**_things_
       **--no-force-**_things_, **--refuse-**_things_
           Force or refuse (**no-force** and **refuse** mean the same thing) to do some things (since dpkg
           1.19.5).  _things_ is a comma separated list of things specified below.  **--force-help**
           displays a message describing them.  Things marked with (*) are forced by default.

           _Warning:_ _These_ _options_ _are_ _mostly_ _intended_ _to_ _be_ _used_ _by_ _experts_ _only._  _Using_ _them_
           _without_ _fully_ _understanding_ _their_ _effects_ _may_ _break_ _your_ _whole_ _system._

           **all**: Turns on (or off) all force options.

           **statoverride-add**: Overwrite an existing stat override when adding it (since dpkg 1.19.5).

           **statoverride-remove**: Ignore a missing stat override when removing it (since dpkg 1.19.5).

           **security-mac**(*): Use platform-specific Mandatory Access Controls (MAC) based security
           when installing files into the filesystem (since dpkg 1.19.5).  On Linux systems the
           implementation uses SELinux.

### --force
           Force an action, even if a sanity check would otherwise prohibit it.  This is necessary
           to override an existing override.  This option is deprecated (since dpkg 1.19.5), it is
           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.

## EXIT STATUS
       **0**   The requested action was successfully performed.

       **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 (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**___**FORCE**
           If set and none of the **--force-**_..._ options have been specified, it will be used as the
           force options to use (since dpkg 1.19.5).

       **DPKG**___**COLORS**
           Sets the color mode (since dpkg 1.18.5).  The currently accepted values are: **auto**
           (default), **always** and **never**.

## FILES
       _/var/lib/dpkg/statoverride_
           File which contains the current list of stat overrides of the system. It is located in
           the **dpkg** administration directory, along with 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.

## SEE ALSO
       [**dpkg**(1)](https://www.chedong.com/phpMan.php/man/dpkg/1/markdown).



1.21.1                                       2025-09-09                         [dpkg-statoverride(1)](https://www.chedong.com/phpMan.php/man/dpkg-statoverride/1/markdown)
