After installing CentOS, the default update source is the official one, which tends to be slow in China. Below are several domestic mirrors that significantly improve download speeds after switching.
Note: If you are logged in as a non-root user, remember to add sudo
before the commands, for instance, sudo yum -y update
.
Preparation
If you have just completed the installation of your new system, make sure to first install curl
or wget
by executing the following command:
|
|
Backup and Update Source
Backup
The Yum source for CentOS 7 and 8 is located at /etc/yum.repos.d/CentOS-Base.repo
. First, let’s create a backup:
|
|
Update
Now, let’s update the source to Aliyun (Alibaba Cloud):
|
|
If you find Aliyunβs source not working well, you can switch to other domestic mirrors. More sources are listed below.
Clear Cache
To clear all Yum cache from the system, use:
|
|
Next, rebuild the Yum cache:
|
|
Update the System
Finally, run the command to update the system:
|
|
At this point, the update is complete.
After switching the source, download speeds are noticeably faster.
Collection of Common Domestic Mirrors:
-
Netease Mirror: http://mirrors.163.com/.help/CentOS7-Base-163.repo
-
Tsinghua University Mirror: https://mirrors.tuna.tsinghua.edu.cn/help/centos/ (Follow this link for specific methods)
-
USTC Mirror: https://mirrors.ustc.edu.cn/help/centos (Follow this link for specific methods)
-
Zhejiang University Mirror: http://mirrors.zju.edu.cn/docs/centos/ (Follow this link for specific methods)
Based on comprehensive testing, the Tsinghua University mirror is exceptionally fast. Tsinghua University is indeed impressive! (βββ‘ββ)