前言
根据网络情况,实在太慢再考虑换源。官方源最匹配,不到万不得已,不要换源。
实测:
公司专线宽带:非常快
家里网通宽带:非常慢,甚至连不上
一、更换步骤
1. 备份原始源文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.bak
2. 编辑软件源文件
sudo nano /etc/apt/sources.list
原内容:
deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
# Uncomment deb-src lines below then 'apt-get update' to enable 'apt-get source'
#deb-src http://deb.debian.org/debian bullseye main contrib non-free
#deb-src http://security.debian.org/debian-security bullseye-security main contrib non-free
#deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
注意仅修改其中链接即可,不要修改其他内容,因为这里32位与64位有所不同,以安装系统版本为准。
参考源:<ins>https://www.raspbian.com/RaspbianMirrors</ins>
南京大学源
deb https://mirror.nju.edu.cn/debian/ bullseye main contrib non-free
deb https://mirror.nju.edu.cn/debian-security/ bullseye-security main contrib non-free
deb https://mirror.nju.edu.cn/debian bullseye-updates main contrib non-free
注意:南京大学源链接与官方源非常匹配,优先使用。2022/05/27测试。
参考文章:<ins>https://blog.csdn.net/ki1381/article/details/123857996</ins>
3. 编辑系统源文件
sudo nano /etc/apt/sources.list.d/raspi.list
原内容:
deb http://archive.raspberrypi.org/debian/ bullseye main
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ bullseye main
修改方式同上。
南京大学源
deb https://mirror.nju.edu.cn/raspberrypi/debian/ bullseye main
4. 最后更新源
sudo apt-get update
sudo apt-get upgrade
更新错误 NO_PUBKEY 9165938D90FDDD2E 处理:
gpg --keyserver keyserver.ubuntu.com --recv-keys 9165938D90FDDD2E
gpg --export --armor 9165938D90FDDD2E | sudo apt-key add -