如何解决由于公钥不可用,无法验证以下签名:NO_PUBKEY EB3E94ADBE1229CF

如何解决由于公钥不可用,无法验证以下签名:NO_PUBKEY EB3E94ADBE1229CF

我正在尝试通过以下链接使用 Ubuntu 在 Linux 上安装 SQL 服务器:https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-ver16&tabs=ubuntu2204

并且,在执行步骤 3 时我收到以下错误消息:

sudo apt-get update
Hit:1 https://cli.github.com/packages stable InRelease
Get:2 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease [3631 B]
Get:3 https://packages.microsoft.com/ubuntu/22.04/mssql-server-2022 jammy InRelease [3603 B]
Err:2 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
Hit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease
Err:3 https://packages.microsoft.com/ubuntu/22.04/mssql-server-2022 jammy InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
Reading package lists... Done
W: GPG error: https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF

答案1

运行以下命令应该可以解决该错误。您还可以

curl-fsSLhttps://packages.microsoft.com/keys/microsoft.asc| sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg

来源:这里

相关内容