dpkg-statoverride

Overriding file ownership and mode in Debian Linux

Supplementary instructions

dpkg-statoverride command is used in Debian Linux to override file ownership and mode, allowing dpkg to invalidate file ownership and mode during package installation.

grammar

dpkg-statoverride(option)

Options

-add: Add an overwrite to the file;
--remove: Remove an overwrite for the file;
--list: Display all rewrite lists;
--update: If the file exists, perform the rewrite operation immediately.

Example

Modify the permission attributes of a folder:

sudo dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3

Forcibly modify the permission attributes of a folder:

sudo dpkg-statoverride --force --update --add root sasl 755 /var/spool/postfix/var/run/saslauthd

Delete the file from the database:

sudo dpkg-statoverride --remove /usr/bin/wall