国内网络环境使用 Debian、Ubuntu 等操作系统,第一件事肯定是更换国内开源镜像。以下为主机大巴收集整理汇总的部分国内开源镜像网站,满足大家使用。
一、教育网镜像
国内开源镜像推荐使用最多的,一般都是教育网镜像,尤其以清华大学、中科大等开源镜像为代表。
1、中国教育和科研计算机网(CERNET)
网站地址:https://mirrors.cernet.edu.cn/
以 Debian12.X 版本为例,修改:/etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.cernet.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.cernet.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.cernet.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.cernet.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.cernet.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.cernet.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb https://mirrors.cernet.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.cernet.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
# deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
网站上也针对各开源操作系统提供使用帮助,例如:Debian 软件仓库镜像使用帮助 。在使用帮助页面上方,还可以自由选择镜像网站,例如选择清华大学、中科大等高校的镜像地址。
2、清华大学开源软件镜像站
网站地址:https://mirrors.tuna.tsinghua.edu.cn/
以 Debian12 为例使用方法:大部分 Debian 的软件源配置文件使用传统的 One-Line-Style,路径为 /etc/apt/sources.list;但是对于容器镜像,从 Debian 12 开始,其软件源配置文件变更为 DEB822 格式,路径为 /etc/apt/sources.list.d/debian.sources。一般情况下,将对应文件中 Debian 默认的源地址 http://deb.debian.org/ 替换为镜像地址即可。
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
使用帮助:https://mirrors.tuna.tsinghua.edu.cn/help/debian/
3、中国科学技术大学开源软件镜像
网站地址:https://mirrors.ustc.edu.cn/
以 Debian12 为例使用方法:一般情况下,将 /etc/apt/sources.list 或 /etc/apt/sources.list.d/debian.sources 文件中 Debian 默认的源地址 http://deb.debian.org/ 替换为 http://mirrors.ustc.edu.cn 即可。
# 默认注释了源码仓库,如有需要可自行取消注释
deb http://mirrors.ustc.edu.cn/debian bookworm main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian bookworm main contrib non-free non-free-firmware
deb http://mirrors.ustc.edu.cn/debian bookworm-updates main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian bookworm-updates main contrib non-free non-free-firmware
# backports 软件源,请按需启用
# deb http://mirrors.ustc.edu.cn/debian bookworm-backports main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian bookworm-backports main contrib non-free non-free-firmware
使用帮助:https://mirrors.ustc.edu.cn/help/debian.html
4、华中科技大学开源镜像站
网站地址:https://mirrors.hust.edu.cn/
以 Debian12 为例使用方法:Debian 使用软件包管理工具 APT 来管理 DEB 软件包。具体来说,Debian 通过修改 /etc/apt/sources.list 配置文件来管理系统软件源。一般情况下,用户可直接将该配置文件中的默认源地址 http://deb.debian.org/ 替换为华中科技大学开源镜像站。
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.hust.edu.cn/debian bookworm main contrib non-free non-free-firmware
# deb-src https://mirrors.hust.edu.cn/debian bookworm main contrib non-free non-free-firmware
deb https://mirrors.hust.edu.cn/debian bookworm-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.hust.edu.cn/debian bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.hust.edu.cn/debian bookworm-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.hust.edu.cn/debian bookworm-backports main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
使用帮助:https://mirrors.hust.edu.cn/docs/debian
5、中国科学院软件研究所开源镜像站
网站地址:https://mirror.iscas.ac.cn/
使用方法:跟上述同理。
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirror.iscas.ac.cn/debian/ bookworm main contrib non-free non-free-firmware
# deb-src https://mirror.iscas.ac.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirror.iscas.ac.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src https://mirror.iscas.ac.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirror.iscas.ac.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src https://mirror.iscas.ac.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
# deb https://mirror.iscas.ac.cn/debian-security bookworm-security main contrib non-free non-free-firmware
# # deb-src https://mirror.iscas.ac.cn/debian-security bookworm-security main contrib non-free non-free-firmware
deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
二、互联网企业开源镜像
1、腾讯软件源
网站地址:https://mirrors.cloud.tencent.com/
公网访问地址:http://mirrors.tencent.com/
内网访问地址:http://mirrors.tencentyun.com/
debian11 配置方式如下:
deb http://mirrors.tencent.com/debian bullseye main contrib non-free
#deb-src http://mirrors.tencent.com/debian bullseye main contrib non-free
deb http://mirrors.tencent.com/debian bullseye-updates main contrib non-free
#deb-src http://mirrors.tencent.com/debian bullseye-updates main contrib non-free
deb http://mirrors.tencent.com/debian-security bullseye-security main contrib non-free
#deb-src http://mirrors.tencent.com/debian-security bullseye-security main contrib non-free
#deb http://mirrors.tencent.com/debian bullseye-backports main contrib non-free
#deb-src http://mirrors.tencent.com/debian bullseye-backports main contrib non-free
#deb http://mirrors.tencent.com/debian bullseye-proposed-updates main contrib non-free
#deb-src http://mirrors.tencent.com/debian bullseye-proposed-updates main contrib non-free
使用帮助:https://mirrors.cloud.tencent.com/help/debian.html
2、阿里巴巴开源镜像站
网站地址:https://developer.aliyun.com/mirror/
debian 11.x 配置如下:
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
使用帮助:https://developer.aliyun.com/mirror/debian
3、网易开源镜像站
网站地址:https://mirrors.163.com/
deb http://mirrors.163.com/debian/ bookworm main non-free contrib
deb http://mirrors.163.com/debian/ bookworm-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ bookworm main non-free contrib
deb-src http://mirrors.163.com/debian/ bookworm-updates main non-free contrib
deb http://mirrors.163.com/debian-security/ bookworm-security main non-free contrib
deb-src http://mirrors.163.com/debian-security/ bookworm-security main non-free contrib
使用帮助:https://mirrors.163.com/.help/debian.html
4、华为开源镜像站
网站地址:https://mirrors.huaweicloud.com/
使用方法:修改 sources.list 文件,将 http://ftp.debian.org 替换成 https://mirrors.huaweicloud.com,同时也将 http://security.debian.org 替换成 https://mirrors.huaweicloud.com 即可。参考如下命令:
sed -i "s@http://ftp.debian.org@https://mirrors.huaweicloud.com@g" /etc/apt/sources.list
sed -i "s@http://security.debian.org@https://mirrors.huaweicloud.com@g" /etc/apt/sources.list
上述均以 Debian 系统为例,其他操作系统同理,从各开源镜像网站地址进去,找到并按照对应操作系统修改即可。
三、官方镜像
1、Debian 全球镜像站
网站地址:https://www.debian.org/mirror/list
2、Ubuntu 镜像列表
网站地址:http://mirrors.ubuntu.com/
Official Archive Mirrors for Ubuntu:https://launchpad.net/ubuntu/+archivemirrors
3、Alpine Linux 官方镜像
列表文件:https://dl-cdn.alpinelinux.org/alpine/MIRRORS.txt
Official Alpine Linux mirrors:https://mirrors.alpinelinux.org/
4、AlmaLinux 官方镜像
AlmaLinux Mirrors:https://mirrors.almalinux.org/