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/

  1. CentOS 5

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

  1. CentOS 6

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

  1. 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
如果以上命令不起作用:

  1. CentOS/RHEL 7

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

  1. CentOS/RHEL 6

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

  1. CentOS/RHEL 5

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

安装IUS仓库

RHEL

  1. RHEL 5

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

  1. RHEL 6

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

  1. RHEL 7

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

CentOS

  1. CentOS 5

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

  1. CentOS 6

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

  1. CentOS 7

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

安装REMI仓库

  1. CentOS/RHEL 7

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

  1. CentOS/RHEL 6

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

  1. CentOS/RHEL 5

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

查看yum软件仓库列表

yum repolist

生成缓存

yum makecache

关键字:linux, centos7, CentOS, uvh

版权声明

本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处。如若内容有涉嫌抄袭侵权/违法违规/事实不符,请点击 举报 进行投诉反馈!

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部