我的目標是安裝 NodeJS。這是我正在運行的命令:
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
由于以下錯誤而失敗:
W: GPG error: https://releases.parity.io/deb release InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B1FE9FFD0787F8B
完整的堆疊跟蹤在附錄 A 中可用。
我試圖解決這個關鍵問題并運行以下命令:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B1FE9FFD0787F8B
結果是由于缺少密鑰而未檢查某些簽名,完整的堆疊跟蹤可在附錄 B 中找到。
然后,當我嘗試使用命令更新系統時,sudo apt-get update出現錯誤:The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B1FE9FFD0787F8B。完整的堆疊跟蹤可在附錄 C 中獲得。
如何解決 gpg 密鑰錯誤以安裝 NodeJS14 或更高版本?
附錄 A
root@vultr:~# curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
## Installing the NodeSource Node.js 16.x repo...
## Populating apt-get cache...
apt-get update
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Get:2 https://releases.parity.io/deb release InRelease [1,468 B]
Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:4 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu bionic InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Err:2 https://releases.parity.io/deb release InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B1FE9FFD0787F8B
Hit:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Reading package lists... Done
W: GPG error: https://releases.parity.io/deb release InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B1FE9FFD0787F8B
E: The repository 'https://releases.parity.io/deb release InRelease' 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.
Error executing the command, exiting
附錄 B
Executing: /tmp/apt-key-gpghome.bZCjA8xQN8/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 3B1FE9FFD0787F8B
gpg: key FF0812D491B96798: 3 duplicate signatures removed
gpg: key FF0812D491B96798: 8 signatures not checked due to missing keys
gpg: key FF0812D491B96798: "Parity Security Team <[email protected]>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
附錄 C
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Get:2 https://releases.parity.io/deb release InRelease [1,468 B]
Hit:3 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu bionic InRelease
Err:2 https://releases.parity.io/deb release InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B1FE9FFD0787F8B
Hit:4 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Reading package lists... Done
W: GPG error: https://releases.parity.io/deb release InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B1FE9FFD0787F8B
E: The repository 'https://releases.parity.io/deb release InRelease' 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:添加-k到curl:
root@vultr:~# curl -k -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
它沒有改變任何東西:
## Installing the NodeSource Node.js 16.x repo...
## Populating apt-get cache...
apt-get update
Get:1 https://releases.parity.io/deb release InRelease [1,468 B]
Hit:2 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu bionic InRelease
Err:1 https://releases.parity.io/deb release InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B1FE9FFD0787F8B
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:4 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Reading package lists... Done
W: GPG error: https://releases.parity.io/deb release InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B1FE9FFD0787F8B
E: The repository 'https://releases.parity.io/deb release InRelease' 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.
Error executing command, exiting```
uj5u.com熱心網友回復:
顯然,releases.parity.io/deb 是未簽名的。This answer建議您可以添加[trusted=yes]到/etc/apt/sources.list以避免面臨此錯誤。
我無法建議它有多安全。
編輯:
搜索以
deb https://releases.parity.io/deb
并將其更改為
deb [trusted=yes] https://releases.parity.io/deb
鏈接答案中提到的其他替代方案也可能值得一試。
更新 1:添加[trusted=yes]正確的檔案
該檔案/etc/apt/sources.list.d/parity.list有一行:
deb [signed-by=/usr/share/keyrings/parity.gpg] https://releases.parity.io/deb release main。應修改此行以使其作業:
deb [trusted=yes,signed-by=/usr/share/keyrings/parity.gpg] https://releases.parity.io/deb release main
uj5u.com熱心網友回復:
可能是 GPG 密鑰環/usr/share/keyrings/已損壞 - 這就是為什么不再匹配密鑰的原因。您可以創建一個新的密鑰環并開始添加密鑰apt-key --keyring。
也許嘗試通過埠請求:80(不知道為什么會這樣):
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3B1FE9FFD0787F8B
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/337642.html
下一篇:如何洗掉vim中的豎線
