MirrorsProxy.Download

换源/apt · Ubuntu / Debian

apt · Ubuntu / Debian 镜像源

Ubuntu 与 Debian 的 apt 软件源国内镜像,apt update / install 提速,含 24.04 deb822 新旧两种格式。

Ubuntu / Debian 官方源海外;国内镜像覆盖 releases / security / updates。Ubuntu 24.04 起改用 deb822 格式,建议保留官方 security 源以避免补丁延迟。

可用镜像源(10)

换源方法

一键替换(最简单)

把默认源域名替换为阿里云,Ubuntu 24.04 前的版本适用;Debian 把 security.debian.org 一并替换。Zorin / Trisquel / Linux Lite 等 Ubuntu 衍生版同样替换 archive.ubuntu.com 即可

sudo sed -i "s|archive.ubuntu.com|mirrors.aliyun.com|g; s|security.ubuntu.com|mirrors.aliyun.com|g" /etc/apt/sources.list
sudo apt update

Ubuntu 24.04+(deb822 格式)

编辑 /etc/apt/sources.list.d/ubuntu.sources,把 URIs 改为

URIs: https://mirrors.aliyun.com/ubuntu/

Debian 手动配置

编辑 /etc/apt/sources.list(以 Debian 12 bookworm、清华源为例)

deb 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 https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware

常见问题

apt update 404?

版本代号与镜像目录不匹配,核对 sources.list / ubuntu.sources。

24.04 配置在哪?

/etc/apt/sources.list.d/ubuntu.sources(deb822 格式)。

security 源要换吗?

建议保留官方,避免安全补丁同步延迟。

使用提示

  • ·换源前备份原配置(`/etc/apt/sources.list`、`*.repo` 等),出问题可回滚。
  • ·保留官方 security 源,避免镜像同步延迟导致安全补丁晚到。
  • ·发行版版本代号(noble/bookworm 等)要与镜像目录一致,别混用。
  • ·企业内网可能强制 DNS / 代理,换源后仍慢先排查网络出口。

其他工具

← 返回换源索引