树莓派换源
-
开启ssh
sudo systemctl enable ssh sudo systemctl start ssh -
查看系统架构
uname -aLinux raspberrypi 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux
raspbian | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
aarch64直接选择Debian源
[debian | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror](https://mirrors.tuna.tsinghua.edu.cn/help/debian/)
-
查询系统版本
lsb_release -aNo LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm -
替换源
替换前的源$ sudo cat /etc/apt/sources.list deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware deb http://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware # Uncomment deb-src lines below then 'apt-get update' to enable 'apt-get source' #deb-src http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware #deb-src http://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware #deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware$ cat /etc/apt/sources.list.d/raspi.list deb http://archive.raspberrypi.com/debian/ bookworm main # Uncomment line below then 'apt-get update' to enable 'apt-get source' #deb-src http://archive.raspberrypi.com/debian/ bookworm main执行替换源
sudo sed -e 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' -i.bak /etc/apt/sources.listsudo sed -e 's|archive.raspberrypi.com/debian|mirrors.tuna.tsinghua.edu.cn/raspberrypi|g' -i.bak /etc/apt/sources.list.d/raspi.list -
更新
sudo apt-get updatesudo apt-get upgrade