当前位置:首页 > 运维 > 正文内容

Debian换中科大的源

22504743954个月前 (08-11)运维142

Debian 系统中更换为中科大(USTC)的软件源可以加快软件包下载速度。以下是详细步骤:

1. 备份当前的 sources.list 文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

2. 编辑 sources.list 文件

使用你喜欢的文本编辑器(如 nano  vim):

sudo nano /etc/apt/sources.list

3. 替换为中科大的源

根据你的 Debian 版本选择对应的源:

Debian 12 (Bookworm)

deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware

Debian 11 (Bullseye)

deb https://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free

Debian 10 (Buster)

deb https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free

4. 更新软件包列表

sudo apt update

5. 升级已安装的软件包(可选)

sudo apt upgrade

注意事项:

 

1.如果你使用的是非自由软件(non-free)或固件(firmware),请确保包含 non-free  non-free-firmware 组件。

 

 

2.如果你使用 HTTPS 源遇到问题,可以将 https 改为 http

 

 

3.对于 Debian 安全更新,较新版本使用了 debian-security 路径,而旧版本可能使用 debian 路径。

 

验证是否生效:

执行 apt update 后,观察是否从中科大镜像下载数据,例如:

Get:1 https://mirrors.ustc.edu.cn/debian bookworm InRelease [147 kB]


返回列表

上一篇:debian安装python3.12.2

没有最新的文章了...

相关文章