# dpkg-statoverride

Debian Linux中覆盖文件的所有权和模式

## 补充说明

**dpkg-statoverride命令** 用于Debian Linux中覆盖文件的所有权和模式，让dpkg于包安装时使得文件所有权与模式失效。

### 语法

```
dpkg-statoverride(选项)
```

### 选项

```
-add：为文件添加一个改写；
--remove：为文件删除一个改写；
--list：显示所有改写列表；
--update：如果文件存在，则立刻执行改写操作。
```

### 实例

修改文件夹的权限属性：

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

强制修改文件夹的权限属性：

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

将文件从数据库中删除：

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hezhiqiang.gitbook.io/linux/ming-ling/dpkg-statoverride.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
