centos7配置aliyun的yum源和epel源

一、配置yum的源地址
1、[root@ yum.repos.d]#wget http://mirrors.aliyun.com/repo/Centos-7.repo
centos7配置aliyun的yum源和epel源
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.建议都注释掉,这个地址是用在阿里云服务器内网的,我们自己的电脑不可能链接得到,所以这个我就注释了。
centos7配置aliyun的yum源和epel源
二、epel源
下载epel源
wget https://mirrors.aliyun.com/repo/epel-7.repo
三、最后执行yum makecache生成缓存。
全部注释后,再次执行 yum clean all; yum makecache
centos7配置aliyun的yum源和epel源
centos7配置aliyun的yum源和epel源
上面图片中有几个没有启用,这两个干嘛的就留给大家去百度吧,如果想要开启的话就更改Centos-7.repo文件中的enabled=1就可以了

转载于:https://blog.51cto.com/aixer95/2325505

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值