本文参考 树莓派4B新手2023保姆级入门指南-更换国内APT源及全局更新-后篇-5 - 知乎
目录
1 树莓派系统情况
用的是树莓派4,系统情况如下
2 换源
sudo vim /etc/apt/source.list
屏蔽掉之前的所有内容(红框部分),填入新的内容(绿框部分),之前就屏蔽的东西不用动(蓝框部分)
绿框部分的内容如下
deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
保存退出后,输入 sudo apt-get update
换源完毕