由于 Ubuntu 20.04 上的 GPG 错误,无法正确安装 mongod

由于 Ubuntu 20.04 上的 GPG 错误,无法正确安装 mongod

我正在尝试通过 cli 在 Ubuntu 上安装 mongodb。运行时sudo apt-get update我收到此信息

Hit:1 http://ca.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease                              
Hit:3 http://dl.google.com/linux/chrome/deb stable InRelease                                  
Hit:4 http://ca.archive.ubuntu.com/ubuntu focal-updates InRelease   
Ign:5 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 InRelease
Hit:6 http://ca.archive.ubuntu.com/ubuntu focal-backports InRelease
Get:7 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release [3,462 B]
Get:8 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release.gpg [801 B]
Ign:8 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release.gpg
Reading package lists... Done
W: GPG error: http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D68FA50FEA312927
E: The repository 'http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

我该如何解决?

答案1

使用以下方式导入公钥

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D68FA50FEA312927

相关内容