[Raspberry PI CM4] Linux 软件源更改

树莓派默认软件源地址是国外的服务器地址,经常出现更新速度慢或者连不上的情况。
我们只需要将软件源换成国内镜像源这个问题就得以解决了。

下面我们更改为阿里云的软件源

  • 首先修改配置文件/etc/apt/sources.list
sudo nano /etc/apt/sources.list
deb https://mirrors.aliyun.com/debian bookworm main contrib non-free non-free-firmware
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb https://mirrors.aliyun.com/debian bookworm-updates main contrib non-free non-free-firmware
  • 然后修改配置文件 /etc/apt/sources.list.d/raspi.list
sudo nano /etc/apt/sources.list.d/raspi.list
deb http://mirrors.aliyun.com/raspbian/raspbian/ bookworm  main non-free contrib rpi
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ bookworm main non-free contrib rpi
  • 修改完成后,重启
sudo reboot
  • 执行更新
sudo apt-get update
sudo apt-get upgrade
  • 软件源签名问题解决办法

如果更新时,提示软件源没有签名无法更新错误

The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9165938D90FDDD2E

可以使用下面的命令添加签名

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9165938D90FDDD2E
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.W4j5VSu42Z/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 9165938D90FDDD2E
gpg: key 9165938D90FDDD2E: public key "Mike Thompson (Raspberry Pi Debian armhf ARMv6+VFP) <mpthompson@gmail.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。