Ubuntuaptupgrade出现error"NO_PUBKEY"的解决

编程

Ubuntu apt upgrade出现错误:

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://apt.postgresql.org/pub/repos/apt bionic-pgdg InRelease: The following signatures couldn"t be verified because the public key is not available: NO_PUBKEY 7FCC7D46ACCC4CF8

W: Failed to fetch http://apt.postgresql.org/pub/repos/apt/dists/bionic-pgdg/InRelease The following signatures couldn"t be verified because the public key is not available: NO_PUBKEY 7FCC7D46ACCC4CF8

执行

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <PUBKEY>

其中 <PUBKEY> 是缺失的 public key for repository。

我这里为:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7FCC7D46ACCC4CF8

然后,再update:

sudo apt-get update

可选方法:

sudo gpg --keyserver pgpkeys.mit.edu --recv-key  <PUBKEY>

sudo gpg -a --export <PUBKEY> | sudo apt-key add -

sudo apt-get update

注意:当导入 key(如使用 apt-key) 就意味着告诉系统你信任这个签名软件。除非确认,不要使用这个导入的方法。

以上是 Ubuntuaptupgrade出现error&quot;NO_PUBKEY&quot;的解决 的全部内容, 来源链接: utcz.com/z/516958.html

回到顶部