raspbian | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
首先通过ssh连接到树莓派,运行
uname -m
由输出
aarch64
可知架构为aarch64
接着运行
lsb_release -a
我的输出为
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
这说明是基于aarch64架构的debian 11,如果不同请在最上方清华链接中选择对应版本
对应于帮助中的内容
# aarch64 用户:编辑 /etc/apt/sources.list
文件,用以下内容取代:
# 默认注释了源码镜像以提高 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
# 对于两个架构,编辑 /etc/apt/sources.list.d/raspi.list
文件,删除原文件所有内容,用以下内容取代:
deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bullseye main
即需要修改两个文件
sudo nano /etc/apt/sources.list
把原来的几行注释(开头添加#)后,通过鼠标右键粘贴
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
之后同时按下ctrl和o 保存 回车确定文件名后 再按下ctrl和x 关闭编辑状态
之后运行
sudo nano /etc/apt/sources.list.d/raspi.list
将原先的内容注释后 添加
deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bullseye main
保存后 运行
sudo apt-get update
更新后即完成换源