Centos yum source to Ali cloud sources

In  Alibaba mirror sites page , in centos aid operations, we have introduced  wgetand curl are 2 ways to downloadCentOS-Base.repo

  1. Backup
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  1. 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.repofile, using the editor in the local open, open the local CentOS-Base.repofile contents are copied to all the centos /etc/yum.repos.d/CentOS-Base.repofile to

  1. Run  yum makecache command generate cache
References
  1. Alibaba mirror sites page  click on the list of centosthe Action column line, click on the "Help" will pop up settings tutorial blanket

Guess you like

Origin www.cnblogs.com/360minitao/p/11960620.html