Switching Ubuntu APT Mirrors for Faster Package Downloads

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)

  1. Open Settings → Software & Updates.
  2. In the Download from drop-down, choose Other…
  3. Click Select Best Server. The tool will ping mirrors and pick the fastest one (takes ~5 min).
  4. If the auto-selection fails, manually enter any URL from the table above.
  5. Close the dialog and allow the cache to reload.

Method 2: Command Line (All Flavors)

  1. Back up the original list: ``` sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

  2. Open the file in your preferred editor: ``` sudo nano /etc/apt/sources.list

  3. Replace every occurrence of http://archive.ubuntu.com/ubuntu/ (or ports for ARM) with your chosen mirror, e.g.: ``` https://mirrors.aliyun.com/ubuntu/

  4. 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

  5. Save the file and refresh the package index: ``` sudo apt update

    
    

After the update finishes, your system will download packages from the new mirror.

Tags: apt Ubuntu mirror package-manager Linux

Posted on Fri, 18 Sep 2026 16:42:35 +0000 by mistercoffee