Ubuntu 软件仓库镜像使用帮助

选择镜像

CERNET - 校园网联合镜像站(mirrorz-302 智能选择)TUNA - 清华大学开源软件镜像站BFSU - 北京外国语大学开源软件镜像站BJTU - 北京交通大学自由与开源软件镜像站CQU - 重庆大学开源软件镜像站NJU - 南京大学开源镜像站DNUI - 大连东软信息学院开源镜像站PKU - 北京大学开源镜像站XJTU - 西安交通大学软件镜像站NJTech - 南京工业大学开源软件镜像站ShanghaiTech GeekPie - 上海科技大学 GeekPie 开源镜像站QLUT - 齐鲁工业大学开源软件镜像站NYIST - 南阳理工学院开源软件镜像站JCUT - 荆楚理工学院开源镜像站NWAFU - Mirrors@NWAFUUSTC - 中国科学技术大学开源软件镜像SJTUG - Siyuan - SJTUG 思源镜像站SUSTech CRA - 南方科技大学开源软件镜像站ISRC-ISCAS - ISCAS 镜像站ZJU - 浙江大学开源软件镜像站SDU - 山东大学镜像站SCAU - 华南农业大学开源软件镜像站UESTC LUG - 电子科技大学镜像站LZUOSS - 兰州大学开源社区镜像站JLU - 吉林大学开源镜像站CQUPT - 重庆邮电大学开源镜像站

是否启用 HTTPS

是否使用 sudo

本镜像仅包含 32/64 位 x86 架构处理器的软件包,在 ARM(arm64, armhf)、PowerPC(ppc64el)、RISC-V(riscv64) 和 S390x 等架构的设备上(对应官方源为 ports.ubuntu.com)请使用 ubuntu-ports 镜像

对于 Ubuntu 不再支持的版本,请参考 Ubuntu 旧版本帮助

在 Ubuntu 24.04 之前,Ubuntu 的软件源配置文件使用传统的 One-Line-Style,路径为 /etc/apt/sources.list;从 Ubuntu 24.04 开始,Ubuntu 的软件源配置文件变更为 DEB822 格式,路径为 /etc/apt/sources.list.d/ubuntu.sources

将系统自带的对应文件做个备份,然后根据格式的选择下面对应的内容替换,即可使用选择的软件源镜像。

传统格式(/etc/apt/sources.list):

Ubuntu 版本

24.04 LTS23.1023.0422.04 LTS20.04 LTS18.04 LTS16.04 LTS14.04 LTS

使用官方安全更新软件源

是否

启用 proposed

否是

启用源码镜像

否是

/etc/apt/sources.list快速配置

复制代码
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.cernet.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.cernet.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.cernet.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.cernet.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.cernet.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.cernet.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
# deb https://mirrors.cernet.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
# # deb-src https://mirrors.cernet.edu.cn/ubuntu/ jammy-security main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.cernet.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# # deb-src https://mirrors.cernet.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
DEB822 格式(/etc/apt/sources.list.d/ubuntu.sources):

Ubuntu 版本

24.04 LTS

使用官方安全更新软件源

是否

启用 proposed

否是

启用源码镜像

否是

/etc/apt/sources.list.d/ubuntu.sources快速配置

复制代码
Types: deb
URIs: https://mirrors.cernet.edu.cn/ubuntu
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# Types: deb-src
# URIs: https://mirrors.cernet.edu.cn/ubuntu
# Suites: noble noble-updates noble-backports
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
# Types: deb
# URIs: https://mirrors.cernet.edu.cn/ubuntu
# Suites: noble-security
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# # Types: deb-src
# # URIs: https://mirrors.cernet.edu.cn/ubuntu
# # Suites: noble-security
# # Components: main restricted universe multiverse
# # Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# Types: deb-src
# URIs: http://security.ubuntu.com/ubuntu/
# Suites: noble-security
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# 预发布软件源,不建议启用
# Types: deb
# URIs: https://mirrors.cernet.edu.cn/ubuntu
# Suites: noble-proposed
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

# # Types: deb-src
# # URIs: https://mirrors.cernet.edu.cn/ubuntu
# # Suites: noble-proposed
# # Components: main restricted universe multiverse
# # Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

因镜像站同步有延迟,可能会导致生产环境系统不能及时检查、安装上最新的安全更新,不建议替换 security 源。

相关推荐
Chuncheng's blog13 分钟前
RedHat7 如何更换yum镜像源
linux
爱莉希雅&&&19 分钟前
shell脚本之条件判断,循环控制,exit详解
linux·运维·服务器·ssh
wei_work@1 小时前
【linux】Web服务—搭建nginx+ssl的加密认证web服务器
linux·服务器·ssl
扶尔魔ocy1 小时前
【Linux C/C++开发】轻量级关系型数据库SQLite开发(包含性能测试代码)
linux·数据库·c++·sqlite
追赶sun2 小时前
Ubuntu 添加系统调用
linux·ubuntu·操作系统·系统调用
北漂老男孩2 小时前
在 Linux 上安装 MATLAB:完整指南与疑难解决方案
linux·运维·matlab
像风一样的男人@3 小时前
Linux --systemctl损坏
linux·运维·服务器
南棱笑笑生3 小时前
20250515测试飞凌的OK3588-C的核心板在Linux R4下适配以太网RTL8211F-CG时跑iperf3的极速
linux·服务器·网络
南方以南_3 小时前
【云实验】搭建个人网盘实验
linux·运维·服务器
酷爱码4 小时前
Linux实现临时RAM登录的方法汇总
linux·前端·javascript