Skip to content

Commit

Permalink
update to bookworm
Browse files Browse the repository at this point in the history
  • Loading branch information
yewq committed Oct 14, 2023
1 parent 048af9b commit a74a5be
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions source/raspberrypi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,24 @@ https://mirrors.ustc.edu.cn/archive.raspberrypi.org/ 或 https://mirrors.ustc.ed
.. warning::
操作前请做好相应备份

一般情况下,将 :file:`/etc/apt/sources.list.d/raspi.list` 文件中默认的源地址 ``http://archive.raspberrypi.org/`` 替换为 ``http://mirrors.ustc.edu.cn/archive.raspberrypi.org/`` 即可。
一般情况下,将 :file:`/etc/apt/sources.list.d/raspi.list` 文件中默认的源地址 ``http://archive.raspberrypi.org/`` (bullseye 及之前版本)或者 ``http://archive.raspberrypi.com/`` (bookworm 及之后版本)替换为 ``http://mirrors.ustc.edu.cn/raspberrypi/`` 即可。

可以使用如下命令:

::

sudo sed -i 's|//archive.raspberrypi.org|//mirrors.ustc.edu.cn/archive.raspberrypi.org|g' /etc/apt/sources.list.d/raspi.list
sudo sed \
-e 's|http://archive.raspberrypi.org|http://mirrors.ustc.edu.cn/raspberrypi|g' \
-e 's|http://archive.raspberrypi.com|http://mirrors.ustc.edu.cn/raspberrypi|g' \
-i.bak \
/etc/apt/sources.list.d/raspi.list

当然也可以直接编辑 :file:`/etc/apt/sources.list.d/raspi.list` 文件(需要使用 sudo)。以下是 Bullseye 的参考配置内容:
当然也可以直接编辑 :file:`/etc/apt/sources.list.d/raspi.list` 文件(需要使用 sudo)。以下是 bookworm 的参考配置内容:

::

deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ bullseye main ui
#deb-src http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ bullseye main ui
deb http://mirrors.ustc.edu.cn/raspberrypi/debian/ bookworm main
#deb-src http://mirrors.ustc.edu.cn/raspberrypi/debian/ bookworm main

更改完 :file:`raspi.list` 文件后请运行 ``sudo apt-get update`` 更新索引以生效。

Expand Down

0 comments on commit a74a5be

Please sign in to comment.