把 Debian 官方软件源更换为清华镜像站(TUNA),能够有效解决因官方源位于国外服务器,国内访问时出现的下载速度慢、连接不稳定以及部分地区网络限制等问题。清华镜像站依托国内节点,可大幅提高下载速度;借助多线 BGP 网络优化,能保障服务的稳定性;采用实时同步机制,确保软件包更新及时;还有专业团队长期维护,提供可靠的技术支持;并且开放社区协作,促进资源共享。这些优势使得用户可以更高效、稳定地获取软件资源,显著提升使用体验。
备份原有软件源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
编辑软件源文件
sudo nano /etc/apt/sources.list
替换为清华镜像源
# Debian 12 Bookworm 正式源
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free
# 安全更新源
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free
# 系统更新源
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free
更新软件索引
sudo apt update
验证镜像源
apt policy
注意事项
- 推荐使用有线网络操作 更换前建议先备份重要数据 如需恢复默认源,可执行:
sudo mv /etc/apt/sources.list.bak /etc/apt/sources.list
其他可选镜像站
- 阿里云镜像站:https://mirrors.aliyun.com/debian/
- 中科大镜像站:https://mirrors.ustc.edu.cn/debian/
- 官方源恢复:https://deb.debian.org/debian/
通过本文操作,您可以快速完成Debian 12系统的软件源优化,享受更流畅的系统更新和软件安装体验。
评论区