LinuxCommandLibrary

dpkg-statoverride

Override file ownership and permissions persistently

SYNOPSIS

dpkg-statoverride {--add|--remove|--update|--list|--listfiles} [options] [arguments]

PARAMETERS

--add
    Add or update statoverride entry for with specified , , and octal (e.g., 0644).

--remove
    Remove statoverride entry for .

--update
    Apply all statoverrides to filesystem immediately (updates affected files).

--list []
    List all overrides or those for specific .

--listfiles
    List files with overrides for given and .

--quiet
    Suppress non-error output messages.

--help
    Display usage summary.

--version
    Output version information.

DESCRIPTION

dpkg-statoverride is a utility in Debian-based Linux distributions for maintaining the /var/lib/dpkg/statoverride file. This file allows system administrators to override file ownership and permissions set by packages during installation, without altering the original package contents.

Packages often install files with root ownership or restrictive permissions. statoverrides enable custom user:group mode settings for specific files, applied by dpkg on install/update and by dpkg-trigger on updates. Common use cases include making configuration files writable by non-root users or adjusting permissions for services.

The command supports adding, removing, listing, and applying overrides. Changes are not immediately reflected in the filesystem; use --update to apply them. It ensures safe, reversible permission management, preventing issues from repackaging or manual edits. Always run as root.

CAVEATS

Overrides are not applied automatically to existing files; always use --update after changes. Direct editing of /var/lib/dpkg/statoverride is discouraged to avoid corruption. Wildcards not supported in paths.

STATOVERRIDE FILE

Overrides stored in /var/lib/dpkg/statoverride; format is mode user group file per line.

APPLICATION TIMING

dpkg applies overrides during dpkg -i or apt install; use --update for manual sync.

HISTORY

Part of the dpkg suite since version 1.4.0.3 (1999); evolved with Debian's package management to support fine-grained permission control amid growing system complexity.

SEE ALSO

Copied to clipboard