借鉴:https://blog.csdn.net/m0_66648798/article/details/126567478
开始
1.确定架构
uname -m
2.查看操作系统版本,换源
根据对应的debian的版本,进行换源
cat /etc/os-release
3.换源
将原本的源文件进行备份
## 备份apt文件 cp /etc/apt/sources.list /etc/apt/sources.list.bak ## 置空 echo > /etc/apt/sources.list ## 写入 cat>/etc/apt/sources.list <<END # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free END
##修改第二个地方 ## 备份 cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.bak ## 置空 echo > /etc/apt/sources.list.d/raspi.list ## 写入 cat>/etc/apt/sources.list.d/raspi.list <<END deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bullseye main END
## 更新源 apt-get update