跳转至

Raspbian

地址

https://mirrors.ustc.edu.cn/raspbian/

说明

Raspbian 软件源

系统架构

armhf

收录版本

  • stretch (oldoldstable)
  • buster (oldstable)
  • bullseye (stable)
  • bookworm (testing)

使用说明

Warning

操作前请做好相应备份

/etc/apt/sources.list 文件中默认的源地址 http://raspbian.raspberrypi.org/ 替换为 http://mirrors.ustc.edu.cn/raspbian/ 即可。

raspbian 2018-04-19 之后的镜像默认源已经更改,用如下命令替换:

sudo sed -i 's|raspbian.raspberrypi.org|mirrors.ustc.edu.cn/raspbian|g' /etc/apt/sources.list

旧版的系统可以用以下命令替换:

sudo sed -i 's|mirrordirector.raspbian.org|mirrors.ustc.edu.cn/raspbian|g' /etc/apt/sources.list
sudo sed -i 's|archive.raspbian.org|mirrors.ustc.edu.cn/raspbian|g' /etc/apt/sources.list

当然也可以直接编辑 /etc/apt/sources.list 文件(需要使用 sudo)。删除原文件所有内容,用以下内容取代(以 Bullseye 示例):

deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ bullseye main contrib non-free rpi
# deb-src http://mirrors.ustc.edu.cn/raspbian/raspbian/ bullseye main contrib non-free rpi

Arm64 架构的 Raspberry Pi OS 仍处于 beta 状态,本镜像上游亦不含此架构。对于 arm64 的 Raspberry Pi OS,可以直接使用 arm64 Debian 的源:

/etc/apt/sources.list
deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian bookworm main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian bookworm-updates main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security bookworm-security main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian-security/ bookworm-security-security main non-free contrib
/etc/apt/sources.list
deb https://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian bullseye main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian bullseye-updates main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security bullseye-security main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian-security/ bullseye-security-security main non-free contrib
/etc/apt/sources.list
deb https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian buster main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian buster-updates main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security buster/updates main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian-security/ buster/updates-security main non-free contrib

编辑此文件后,请使用 sudo apt-get update 命令,更新软件索引。

同时也可能需要更改 archive.raspberrypi.org 源,请参考 raspberrypi

相关链接