sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo sed -i 's|raspbian.raspberrypi.org|mirrors.ustc.edu.cn/raspbian|g' /etc/apt/sources.list
sudo cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.bak
sudo sed -i 's|archive.raspberrypi.org|mirrors.ustc.edu.cn|g' /etc/apt/sources.list.d/raspi.list
运行 sudo apt-get update 刷新仓库,不出意外会发生错误
root@raspberrypi:~/.ssh# sudo apt-get update
Hit:1 http://mirrors.ustc.edu.cn/raspbian/raspbian buster InRelease
Get:2 http://mirrors.ustc.edu.cn/debian buster InRelease [121 kB]
Err:2 http://mirrors.ustc.edu.cn/debian buster InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY DCC9EFBF77E11517
Reading package lists... Done
W: GPG error: http://mirrors.ustc.edu.cn/debian buster InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY DCC9EFBF77E11517
E: The repository 'http://mirrors.ustc.edu.cn/debian buster 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.