Centos-7 modifies yum source to domestic yum source

The download of the yum source from the foreign address is slow, and it breaks halfway down. For this reason, it is changed to the domestic yum source address.

 

Domestic is ali and Netease

 

Take centos7 as an example, modify it to Ali's yum source

 

1. Backup the local yum source

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

 

2. Get the Aliyum source configuration file

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

 

3. Update the cache

 yum makecache 

 

4. View

 yum -y update 

 

5. Finally, you can link to the domestic mirror, which is actually the XXX of that city. . .

 

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

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

yum makecache

yum -y update 

 

You can learn from centos to modify the default yum source address  

 

Guess you like

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