centos7 yum update source

Yum source file into the first cd /etc/yum.repo.d/ 

1, repo_bak create a directory for saving the system in the original yum repo file.

sudo mkdir repo_bak

2, backup yum source file to repo_bak

sudo mv * .repo repo_bak /

3, Netease and Ali mirror site to download the open source version of the system corresponding to the repo file

wget http://mirrors.aliyun.com/repo/Centos-7.repo

4, clear the system cache yum yum and generate a new cache

yum yum clean all clear the system cache

yum yum makecache generate cache

5, the installation source epel

yum list | grip epel- release 

yum install -y epel-release

6, the use of open source Ali mirroring provides a source of epel

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

7, once again clear the system cache yum, yum and regenerate new cache

yum yum clean all Clear Cache

yum yum makecache generate cache

8, view system available yum yum source and all sources

yum repolist enabled

 

Guess you like

Origin www.cnblogs.com/sheshidu/p/11614514.html