首页 > 其他 > 详细

centos7配置aliyun的yum源和epel源

时间:2018-12-03 19:22:14      阅读:181      评论:0      收藏:0      [点我收藏+]
一、配置yum的源地址
1、[root@ yum.repos.d]#wget http://mirrors.aliyun.com/repo/Centos-7.repo
技术分享图片
2、修改$releasever的值
我们获取到的配置文件Centos-7.repo打开后有个$releasever,这个是yum变量,我们需要替换掉,否则源没法使用,如果不替换可以试一下yum的命令查看显示什么就知道了。
根据自己系统版本把$releasever替换为相对应的版本数字。
使用如下命令替换$releasever,
[root@linuxprobe ~]# sed -i ‘s/$releasever/7/g‘ /etc/yum.repos.d/Centos-7.repo
3、注释aliyuncs.com
centos-7.repo文件里面有的是使用的是https://mirrors.aliyuncs.com.建议都注释掉,这个地址是用在阿里云服务器内网的,我们自己的电脑不可能链接得到,所以这个我就注释了。
技术分享图片
二、epel源
下载epel源
wget https://mirrors.aliyun.com/repo/epel-7.repo
三、最后执行yum makecache生成缓存。
全部注释后,再次执行 yum clean all; yum makecache
技术分享图片
技术分享图片
上面图片中有几个没有启用,这两个干嘛的就留给大家去百度吧,如果想要开启的话就更改Centos-7.repo文件中的enabled=1就可以了

centos7配置aliyun的yum源和epel源

原文:http://blog.51cto.com/aixer95/2325505

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