在Centos 5.x或6.x上安装RHEL EPEL Repo

技术 秋水逸冰 37441浏览 4评论

repository,资源库,源的意思。RHEL EPEL(Extra Packages for Enterprise Linux) Repo是Linux发行版中最大的软件仓库之一,免费,丰富的软件包更新。

安装步骤
Centos 5.x

wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -ivh epel-release-5-4.noarch.rpm
rpm -ivh remi-release-5.rpm

Centos 6.x

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -ivh epel-release-6-8.noarch.rpm
rpm -ivh remi-release-6.rpm

完成后的设置

ls -1 /etc/yum.repos.d/epel* /etc/yum.repos.d/remi.repo

返回

/etc/yum.repos.d/epel.repo
/etc/yum.repos.d/epel-testing.repo
/etc/yum.repos.d/remi.repo

允许remi repository

vi /etc/yum.repos.d/remi.repo

编辑[remi]下的enabled选项从0设为1

[remi]
name=Les RPM de remi pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

至此,安装完成。

安装完运行yum报错:

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

解决办法:

vi /etc/yum.repos.d/epel.repo

编辑[epel]下的baseurl前的#号去掉,mirrorlist前添加#号。正确配置如下:

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

再运行

yum makecache

英文出自于这里

转载请注明:秋水逸冰 » 在Centos 5.x或6.x上安装RHEL EPEL Repo

发表我的评论
取消评论

请输入正确答案后提交评论 *超出时限。 请再次填写验证码。

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (4)

  1. 66666666666666666666
    glasirius7年前(2017-03-07)回复
  2. 解決了我的問題, 謝謝
    guest02247年前(2017-02-24)回复
  3. Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again 根本解决办法: yum upgrade ca-certificates --disablerepo=epel 允许remi repository yum install -y yum-utils yum-config-manager --enable remi
    xiaoyutou9年前(2015-10-31)回复
  4. 最近试了,在baseUrl得修改成https才能够成功。
    jamzhou9年前(2015-01-28)回复