如何添加yum源​和修改默认源、对系统yum源进行扩展

如何添加yum源​和修改默认源、对系统yum源进行扩展​

1 .首先进行下载yum repolist

            yum  repolist​

2.修改默认源配置​  ​

   base: mirror.lzu.edu.cn * extras: mirrors.sohu.com * updates: mirrors.sohu.com

修改成 

* base: mirrors.aliyun.com

* extras: mirrors.aliyun.com

 * updates: mirrors.aliyun.com

修改成aliyun 下载速度会提高

修改步骤 :1.登录https://opsx.alibaba.com/mirror

                   2.进去页面选择centos 6.9(看自己版本) 点击帮助   根据提示先备份

                   mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

                    3.下载新的CentOS-Base.repo 到/etc/yum.repos.d/

       

CentOS 5

<code style="box-sizing: border-box; display: inline; font-family: monospace,monospace; font-size: 14px; line-height: 21px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left; vertical-align: baseline;">wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo</code>

或者

<code style="box-sizing: border-box; display: inline; font-family: monospace,monospace; font-size: 14px; line-height: 21px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left; vertical-align: baseline;">curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo</code>

CentOS 6

<code style="box-sizing: border-box; display: inline; font-family: monospace,monospace; font-size: 14px; line-height: 21px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left; vertical-align: baseline;">wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo</code>

或者

<code style="box-sizing: border-box; display: inline; font-family: monospace,monospace; font-size: 14px; line-height: 21px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left; vertical-align: baseline;">curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo</code>

CentOS 7

<code style="box-sizing: border-box; display: inline; font-family: monospace,monospace; font-size: 14px; line-height: 21px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left; vertical-align: baseline;">wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo</code>

或者

<code style="box-sizing: border-box; display: inline; font-family: monospace,monospace; font-size: 14px; line-height: 21px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left; vertical-align: baseline;" data-spm-anchor-id="0.0.0.i4.18b8c8ebinV6VS">curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo</code>

命令复制所需内容即可

就完成yum源下载

扩展yum源

1.先进行下载

  yum install epel-release -y

2.进行扩展

  1.登录网站  https://opsx.alibaba.com/mirror ctrl +f 页面搜索 epel 

     寻找当前行? 然后进行备份

    mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup

    mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup

    二选一

2.

2、下载新repo 到/etc/yum.repos.d/

epel(RHEL 7)


<code style="box-sizing: border-box; display: inline; font-family: monospace,monospace; font-size: 14px; line-height: 21px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left; vertical-align: baseline;"> wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo</code>

epel(RHEL 6)

<code style="box-sizing: border-box; display: inline; font-family: monospace,monospace; font-size: 14px; line-height: 21px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left; vertical-align: baseline;"> wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo</code>

epel(RHEL 5)

<code style="box-sizing: border-box; display: inline; font-family: monospace,monospace; font-size: 14px; line-height: 21px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: left; vertical-align: baseline;"> wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-5.repo</code>

文件达到20000

就完成扩展源

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值