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 源。

相关推荐
fruge2 小时前
Ubuntu服务器已下载Nginx安装包的安装指南
服务器·nginx·ubuntu
Do_GH2 小时前
【Linux】07.Ubuntu开发环境部署
linux·运维·ubuntu
CHH32133 小时前
在 Mac/linux 的 VSCode 中使用Remote-SSH远程连接 Windows
linux·windows·vscode·macos
tryCbest3 小时前
Linux使用Docker部署项目后期更新
linux·运维·docker
孤独得猿3 小时前
聊天室项目开发——etcd的安装和使用
linux·服务器·c++·etcd
siriuuus3 小时前
Linux Tomcat 简单使用及 Nginx 反向代理
linux·nginx·tomcat
呱呱巨基4 小时前
vim编辑器
linux·笔记·学习·编辑器·vim
竹等寒4 小时前
Linux-网络安全私房菜(二)
linux·服务器·web安全
YuCaiH4 小时前
Linux文件处理
linux·笔记·嵌入式
sulikey5 小时前
从实验出发深入理解Linux目录权限:r、w、x分别控制什么?能否进入目录到底由谁决定?
linux·运维·服务器·ubuntu·centos