Debian 11(bullseye)配置国内源

1.前置工作

Debian 的软件源配置文件是 /etc/apt/sources.list。备份配置文件

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

若拉取 https 源失败,可先使用 http 源并安装:

sudo apt install apt-transport-https ca-certificates

2.编辑文件 /etc/apt/sources.list

sudo vi /etc/apt/sources.list
或
sudo vim /etc/apt/sources.list
或
sudo nano /etc/apt/sources.list

3.将下面内容添加进/etc/apt/sources.list,记得将原文件的所有内容注释掉,按需选择国内源

# 默认注释了源码镜像以提高 apt update 速度
# 清华大学的软件源
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free 
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free 
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free 
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free 
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free 
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free 
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free 
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free

# 阿里云的软件源
# deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
# deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
# deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
# deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main
# deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
# deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
# deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
# deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib

# 中科大的软件源
# deb https://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free 
# deb-src 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-src 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-src 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 
# deb-src https://mirrors.ustc.edu.cn/debian-security bullseye-security main contrib non-free

4.最后更新软件列表并更新软件

sudo apt update && sudo apt upgrade -y
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐