In Alibaba mirror sites page , in centos
aid operations, we have introduced wget
and curl
are 2 ways to downloadCentOS-Base.repo
- Backup
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
- Download the new CentOS-Base.repo to /etc/yum.repos.d/
2.1. CentOS-Base.repo link Alibaba mirror station
CentOS 5: http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6: http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7: http://mirrors.aliyun.com/repo/Centos-7.repo
Use wget to download software
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo #CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo #CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo #CentOS 7
Or use the curl to download software
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo #CentOS 5
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo #CentOS 6
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo #CentOS 7
Or directly download the corresponding version of the CentOS-Base.repo
file, using the editor in the local open, open the local CentOS-Base.repo
file contents are copied to all the centos /etc/yum.repos.d/CentOS-Base.repo
file to
- Run
yum makecache
command generate cache
References
- Alibaba mirror sites page click on the list of
centos
the Action column line, click on the "Help" will pop up settings tutorial blanket