# 记一次丢失GPG公钥

记一次丢失GPG公钥，而导致ubuntu/debian 的apt频繁提示报错。

```
W: GPG error: http://security.ubuntu.com trusty-security Release: 
The following signatures couldn't be verified because the public key is not available: 
NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
```

如果未修復這些錯誤，apt 在安裝或升級軟體包時會遇到問題。

apt 打包系統具有一組可信密鑰，用於確定是否可以對軟體包進行身份驗證，從而信任安裝在系統上。

```
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
```

让我们键入这样的命令，将后面recv-keys 后面值替换为您报错的公钥值。

再次apt-get update 即可解决！


---

# 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://blog.jsmsr.com/blog/ji-yi-ci-diu-shi-gpg-gong-yue.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.
