Modify the yum source to Alibaba Cloud's

Replace the yum source of Centos with the domestic Alibaba Cloud source

author:headsen chen

date:2018-04-28  13:33:41 

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2. Download the new CentOS-Base.repo to /etc/yum.repos.d/

 CentOS 5 (currently deactivated, invalid)

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

 Cent OS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

Cent OS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3. Then run yum makecache to generate the cache

yum clean all

yum makecache

 

4. Query

yum repolist

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325015498&siteId=291194637