wsl安装nodejs出现W: GPG error: https://deb.nodesource.com/node_16.x foc和 NO_PUBKEY的问题处理

x
xiezixing
发布于 4 个月前

最新换了台新电脑,但是在WSL中安装node的时候就出错了:

Err:4 https://deb.nodesource.com/node_16.x focal InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1655A0AB68576280
Reading package lists... Done
W: GPG error: https://deb.nodesource.com/node_16.x focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1655A0AB68576280
E: The repository 'https://deb.nodesource.com/node_16.x focal 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

查询了各种资料,都没有用,直到找到一个文档,发现修改/etc/apt/sources.list.d/nodesource.list可解决问题:

deb [signed-by=/usr/share/keyrings/nodesource.gpg  allow-insecure=yes] https://deb.nodesource.com/node_16.x focal main
deb-src [signed-by=/usr/share/keyrings/nodesource.gpg allow-insecure=yes] https://deb.nodesource.com/node_16.x focal main

相关文章推荐
评论区
暂未开放
相关文章推荐