Popular Chinese APT Mirrors
| Provider | Base URL |
|---|---|
| USTC | https://mirrors.ustc.edu.cn/ubuntu/ |
| Huawei Cloud | https://repo.huaweicloud.com/ubuntu/ |
| Alibaba Cloud | https://mirrors.aliyun.com/ubuntu/ |
| Tsinghua University | https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ |
| NetEase | https://mirrors.163.com/ubuntu/ |
| Sohu | https://mirrors.sohu.com/ubuntu/ |
APT rpeositories are published in two primary architectures:
- x86_64 (amd64) – use
ubuntu - aarch64 (arm64) – use
ubuntu-ports
Run uname -m to determine your machine’s architecture.
Configuring the Mirror
Method 1: GUI (Ubuntu Desktop)
- Open Settings → Software & Updates.
- In the Download from drop-down, choose Other…
- Click Select Best Server. The tool will ping mirrors and pick the fastest one (takes ~5 min).
- If the auto-selection fails, manually enter any URL from the table above.
- Close the dialog and allow the cache to reload.
Method 2: Command Line (All Flavors)
-
Back up the original list: ``` sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
-
Open the file in your preferred editor: ``` sudo nano /etc/apt/sources.list
-
Replace every occurrence of
http://archive.ubuntu.com/ubuntu/(orportsfor ARM) with your chosen mirror, e.g.: ``` https://mirrors.aliyun.com/ubuntu/ -
Ensure both binary and source entries exist (optional but recomemnded): ```
Binary packages
deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse deb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
Corresponding source packages (uncomment if needed)
deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
-
Save the file and refresh the package index: ``` sudo apt update
After the update finishes, your system will download packages from the new mirror.