【分布式】解决树莓派4B-64位更换清华源问题(GPG error:because the public key is not available)

发布时间 2023-10-16 14:10:55作者: zxddesk

【分布式】解决树莓派4B-64位更换清华源问题(GPG error:because the public key is not available)

别出BUG求求了

于 2022-04-30 16:15:38 发布

阅读量3.1k
收藏 18

点赞数 7
分类专栏: 分布式 文章标签: debian bash 树莓派 清华源 public key
版权

分布式
专栏收录该内容
18 篇文章1 订阅
订阅专栏
一、首先是安装清华源,按照网上的教程来在官网安装(base 树莓派):
首先确定系统版本:
more /etc/debian_version
1
然后根据系统版本来跑上面给的指令:

# armv7l 用户:编辑 `/etc/apt/sources.list` 文件,删除原文件所有内容,用以下内容取代
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi
# deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi

# armv7l 用户如果需要开启 multi-arch 使用 arm64 软件源,需要在 `/etc/apt/sources.list` 中加上
deb [arch=arm64] http://mirrors.tuna.tsinghua.edu.cn/raspbian/multiarch/ buster main

# aarch64 用户:编辑 `/etc/apt/sources.list` 文件,用以下内容取代:
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free

# 对于两个架构,编辑 `/etc/apt/sources.list.d/raspi.list` 文件,删除原文件所有内容,用以下内容取代:
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main


二、更新软件源
在执行sudo apt-get update后出现以下的问题:

Reading package lists… Done
W: GPG error: http://mirrors.tuna.tsinghua.edu.cn/raspbian/multiarch bullseye InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY E77FC0EC34276B4B
E: The repository ‘http://mirrors.tuna.tsinghua.edu.cn/raspbian/multiarch bullseye 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

The following signatures couldn’t be verified because the public key
is not available: NO_PUBKEY E77FCOEC34276B4B Reading package lists…
Done W: GPG error: http://mirrors. tuna. ts inghua. edu.
cn/raspbian/multiarch bullseye InRelease: The following signatures co
uldn’t be verified because the public key is not available: NO_PUBKEY
E77FCOEC34276B4B E: The repository ’ http://mirrors. tuna. ts inghua.
edu. cn/raspb ian/multiarch bullseye InRelease’ is not signed. N:
Updat ing 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.

三、解决办法:
更换源之后需要添加公钥,执行以下命令:

注意:这里的recv-keys就是报错中的key,粘贴过来即可:

gpg --keyserver keyserver.ubuntu.com --recv-keys E77FC0EC34276B4B
gpg --export --armor E77FC0EC34276B4B | sudo apt-key add -
————————————————
版权声明:本文为CSDN博主「别出BUG求求了」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_39589455/article/details/124514099