dpkg-statoverride(1) dpkg suite dpkg-statoverride(1)

# [NAME](#NAME)

dpkg-statoverride - override ownership and mode of files

# [SYNOPSIS](#SYNOPSIS)

**dpkg-statoverride** \[*option*...] *command*

# [DESCRIPTION](#DESCRIPTION)

“**stat overrides**” are a way to tell [**dpkg**(1)](/man/os/dpkg/dpkg.1) 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](#COMMANDS)

[**--add** *user group mode path*](#add)

Add an override for *path*. *path* does not need to exist nor be known to **dpkg** 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)

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

[**--list** \[*glob-pattern*\]](#list)

List all overrides. If a glob pattern is specified restrict the output to overrides which match the glob.

[**--help**](#help)

Show the usage message and exit.

[**--force-help**](#force)

Give help about the **--force-thing** options.

Supported since dpkg 1.19.5.

[**--version**](#version)

Show the version and exit.

# [OPTIONS](#OPTIONS)

[**--admindir** *directory*](#admindir)

Set the administrative directory to *directory*. This is where the *statoverride* file is stored. Defaults to «*/var/lib/dpkg*» if **DPKG\_ADMINDIR** has not been set.

[**--instdir** *directory*](#instdir)

Set the installation directory, which refers to the directory where packages get installed. Defaults to «*/*» if **DPKG\_ROOT** has not been set.

Supported since dpkg 1.19.2.

[**--root** *directory*](#root)

Set 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**](#force~2)

[**--no-force-things**, **--refuse-things**](#no)

Force or refuse (**no-force** and **refuse** mean the same thing) to do some things. *things* is a comma separated list of things specified 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.

[**all**:](#all)

Turns on (or off) all force options.

[**statoverride-add**:](#statoverride)

Overwrite an existing stat override when adding it.

Supported since dpkg 1.19.5.

[**statoverride-remove**:](#statoverride~2)

Ignore a missing stat override when removing it.

Supported since dpkg 1.19.5.

[**security-mac**(\*):](#security)

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**:](#not)

Try to (de)install things even when not root.

Supported since dpkg 1.21.8.

[**--force**](#force~3)

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**](#update)

Immediately try to change the *path* to the new owner and mode if it exists.

[**--quiet**](#quiet)

Be less verbose about what we do.

# [EXIT STATUS](#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](#ENVIRONMENT)

[**DPKG\_ROOT**](#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**](#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**](#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**](#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**](#DPKG_COLORS)

Sets the color mode. The currently accepted values are: **auto** (default), **always** and **never**.

Supported since dpkg 1.18.5.

[**DPKG\_NLS**](#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**](#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**](#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](#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](#SEE_ALSO)

[**dpkg**(1)](/man/os/dpkg/dpkg.1).

2026-09-09 1.23.11-dirty

---

Document: dpkg-statoverride(1) from dpkg 1.23.11-r0 (Chainguard OS)
Source: https://git.dpkg.org/git/dpkg/dpkg.git
