centos7 更新源

centos7 yum源更新

 

先进入到yum源文件cd /etc/yum.repo.d/ 

1、创建一个repo_bak目录,用于保存系统中原来yum的repo文件。

sudo mkdir repo_bak

2、备份yum源文件至repo_bak

sudo mv *.repo repo_bak/

3、到网易和阿里开源镜像站点下载系统对应版本的repo文件

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

4、清除系统yum缓存并生成新的yum缓存

yum clean all 清除系统yum 缓存

yum makecache 生成yum缓存

5、安装epel源

yum list | grep epel-release 

yum install -y epel-release

6、使用阿里开源镜像提供的epel源

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

7、再次清除系统yum缓存,并重新生成新的yum缓存

yum clean all 清除yum缓存

yum makecache 生成yum缓存

8、查看系统可用的yum源和所有的yum源

yum repolist enabled

人生如修仙,岂是一日间。何时登临顶,上善若水前。
原文地址:https://www.cnblogs.com/f-society/p/12933710.html