Aliyun Yum Mirror Configuration¶
Aliyun Yum Mirror Configuration refers to the process of replacing the default package repository sources in CentOS with mirrors hosted by Aliyun.^[600-developer__docker__yum-aliyun.md] This is often done to improve download speeds and network stability for users within China or those closer to Aliyun's infrastructure.
Procedure¶
The configuration process involves backing up existing repository definitions, downloading the new Aliyun configuration file, and generating the necessary cache^[600-developer__docker__yum-aliyun.md].
1. Backup existing repository¶
It is standard practice to backup the current default repository configuration file before making changes^[600-developer__docker__yum-aliyun.md]. This is accomplished by renaming CentOS-Base.repo to CentOS-Base.repo.backup in the /etc/yum.repos.d/ directory[600-developer__docker__yum-aliyun.md][600-developer__docker__yum-aliyun.md].
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2. Download Aliyun repository¶
For CentOS 7 systems, the specific Aliyun mirror configuration file can be downloaded directly to the repository directory^[600-developer__docker__yum-aliyun.md].
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3. Generate cache¶
After the new repository file is in place, the package manager cache must be regenerated to recognize the changes^[600-developer__docker__yum-aliyun.md].
yum makecache
Sources¶
^[600-developer__docker__yum-aliyun.md]
Related¶
- [[Package Management]]
- [[CentOS]]
- [[System Administration]]