Ubuntu
Ubuntu is a Debian-based Linux distribution. This page covers switching apt sources to an Alibaba Cloud mirror.
Configuration#
The location of the apt source file depends on the release:
- Ubuntu 24.04 LTS uses the deb822-style
/etc/apt/sources.list.d/ubuntu.sourcesby default. - Ubuntu 22.04 LTS and older usually use
/etc/apt/sources.list.
Run the commands below in a root shell. Back up the file first, then pick one mirror.
Back up the apt source file#
Ubuntu 24.04 LTS:
Ubuntu 22.04 LTS and older:
Use the Alibaba Cloud public mirror#
On Ubuntu 24.04 LTS, overwrite ubuntu.sources and update the index:
On Ubuntu 22.04 LTS and older, replace the URLs in sources.list and update the index:
Use the Alibaba Cloud ECS VPC mirror#
On Alibaba Cloud ECS, you can use the VPC internal mirror instead.
Ubuntu 24.04 LTS:
Ubuntu 22.04 LTS and older: