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

一、首先是安装清华源,按照网上的教程来在官网安装(base 树莓派):

  • 首先确定系统版本:
more /etc/debian_version
  • 然后根据系统版本来跑上面给的指令:
    在这里插入图片描述
# 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 -

猜你喜欢

转载自blog.csdn.net/weixin_39589455/article/details/124514099
今日推荐