首先备份原设置
cp /etc/apt/sources.list ~/sources.list.bak
cp /etc/apt/sources.list.d/raspi.list ~/raspi.list.bak
修改配置
/etc/apt/sources.list
文件替换内容如下(原内容删除)
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
/etc/apt/sources.list.d/raspi.list
文件替换内容如下(原内容删除)
deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bookworm main
这两份文件保存好后,执行:apt-get update -y
。换源完成