首页 > 其他 > 详细

centos7 yum源更新

时间:2019-10-01 00:05:11      阅读:142      评论:0      收藏:0      [点我收藏+]

先进入到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

 

centos7 yum源更新

原文:https://www.cnblogs.com/sheshidu/p/11614514.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!