Centos/RedHat 7/6/5切换阿里云源并安装EPEL/IUS/REMI仓库

  • Centos/RedHat 7/6/5切换阿里云源并安装EPEL/IUS/REMI仓库 

    CentOS安装完毕后,默认的yum源是国外的,国内访问速度很慢,需要切换为国内的源,这里选用的是阿里云的源。此外,一些常用的仓库,如epel和ius,最好也一并安装了。


    切换基本源为阿里云源 
    备份 
    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 
    下载新的CentOS-Base.repo 到/etc/yum.repos.d/

    CentOS 5


    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo 

    CentOS 6


    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo 

    CentOS 7


    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 
    安装第三方源 
    安装EPEL仓库 
    yum install -y epel-release 

    如果以上命令不起作用:

     

    CentOS/RHEL 7


    rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm 

    CentOS/RHEL 6


    rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 

    CentOS/RHEL 5


    rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm 
    安装IUS仓库 
    RHEL 

    RHEL 5


    rpm -Uvh https://rhel5.iuscommunity.org/ius-release.rpm 

    RHEL 6


    rpm -Uvh https://rhel6.iuscommunity.org/ius-release.rpm 

    RHEL 7


    rpm -Uvh https://rhel7.iuscommunity.org/ius-release.rpm 

     


    CentOS 

    CentOS 5


    rpm -Uvh https://centos5.iuscommunity.org/ius-release.rpm 

    CentOS 6


    rpm -Uvh https://centos6.iuscommunity.org/ius-release.rpm 

    CentOS 7


    rpm -Uvh https://centos7.iuscommunity.org/ius-release.rpm 
    安装REMI仓库 

    CentOS/RHEL 7


    rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm 

    CentOS/RHEL 6


    rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 

    CentOS/RHEL 5


    rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm 
    查看yum软件仓库列表 
    yum repolist 
    生成缓存 
    yum makecache

转载于:https://my.oschina.net/sorryd/blog/3005804

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值