apt 更新失败:NO_PUBKEY E88979FB9B30ACF2

apt 更新失败:NO_PUBKEY E88979FB9B30ACF2

我如何通过更新修复此错误:

Err:26 https://storage.googleapis.com/download.dartlang.org/linux/debian stable Release.gpg
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E88979FB9B30ACF2
<omitted>
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://storage.googleapis.com/download.dartlang.org/linux/debian stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E88979FB9B30ACF2
W: Failed to fetch https://storage.googleapis.com/download.dartlang.org/linux/debian/dists/stable/Release.gpg  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E88979FB9B30ACF2
W: Some index files failed to download. They have been ignored, or old ones used instead.

答案1

 wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo gpg  --dearmor -o /usr/share/keyrings/dart.gpg

这将下载密钥并将其放在 /usr/share/keyrings/ 下。删除 /etc/apt/sources.list.d/ 下此 repo 的旧 sources.list

echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list

这将创建新的并再试一次。

答案2

如果不修复这些错误,apt 在安装或升级软件包时就会出现问题。apt 打包系统有一组受信任的密钥,用于确定软件包是否可以验证,从而可以信任地安装在系统上。有一个快速修复方法。

查看上述错误,apt 告诉我们缺少以下键:E88979FB9B30ACF2 要添加这些键,请运行以下命令:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E88979FB9B30ACF2

如果您的系统缺少的密钥不同,只需用您的密钥替换上述命令末尾的密钥并运行它。

相关内容