Ubuntu
Preparation (Mandatory)
To ensure stable resolution of the package mirror, ensure the hosts file is configured with correct domain name resolution before configuration. If not added, add the following content to the /etc/hosts file before configuring the package mirror.
cat >> /etc/hosts << EOF
10.251.102.1 mirrors.shanhe.com
EOF
Ubuntu
Ubuntu Usage Guide
Ubuntu repository URL: https://mirrors.shanhe.com/ubuntu/
Ubuntu-CD image URL: https://mirrors.shanhe.com/ubuntu-cdimage/
Ubuntu-Cloud image URL: https://mirrors.shanhe.com/ubuntu-cloud-images/
Ubuntu-Ports repository URL: https://mirrors.shanhe.com/ubuntu-ports/
Ubuntu-Releases image URL: https://mirrors.shanhe.com/ubuntu-releases/
ubuntu-cloud-archive image URL: https://mirrors.shanhe.com/ubuntu-cloud-archive/
Backup Configuration File
Execute the following command:
sudo cp -a /etc/apt/sources.list /etc/apt/sources.list.bak
Modify the sources.list file
Replacehttp://archive.ubuntu.comandhttp://security.ubuntu.comwithhttps://mirrors.shanhe.com, as shown in the following command:
sudo sed -i "s@http://.*archive.ubuntu.com@https://mirrors.shanhe.com@g" /etc/apt/sources.list
sudo sed -i "s@http://.*security.ubuntu.com@https://mirrors.shanhe.com@g" /etc/apt/sources.list
Update the index
Execute the following command:
apt-get update