How to enable EPEL repository on Centos

Install-and-Enable-EPEL-Repo-on-CentOS

How to enable EPEL repository on Centos

What’s an ‘EPEL repository’?

The EPEL repository is managed by the EPEL group, which is a Special Interest Group within the Fedora Project. The ‘EPEL’ part is an abbreviation that stands for Extra Packages for Enterprise Linux. The EPEL group creates, maintains and manages a high-quality set of additional packages. These packages may be software not included in the core repository, or sometimes updates which haven’t been provided yet.

The EPEL repository can be used with the following Linux Distributions:

  • Red Hat Enterprise Linux (RHEL)
  • CentOS
  • Scientific Linux
  • Oracle Linux

Enabling the EPEL repo

Method I. Installing EPEL on CentOS via yum

By far CentOS is the easiest distro to install EPEL on. The CentOS distribution includes a repo called ‘CentOS Extras’ by default. Within this repo users can find a EPEL package, so in this case enabling EPEL is as easy as installing any other package.

just run the following command:

# yum install epel-release

If, for whatever reason, your version of CentOS is missing the CentOS Extras repo necessary for this to work you can follow the directions below.

Method II. Officially install EPEL via fedoraproject

  1. RHEL/CentOS 6:

    # yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
  2. RHEL/CentOS 7:

    # yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    • on RHEL 7 it is recommended to also enable the optional, extras, and HA repositories since EPEL packages may depend on packages from these repositories:
      # subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"  --enable "rhel-ha-for-rhel-*-server-rpms"
  3. RHEL/CentOS 8:

    # yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    • on RHEL 8 it is required to also enable the codeready-builder-for-rhel-8-*-rpms repository since EPEL packages may depend on packages from it:
      # ARCH=$(/bin/arch)
      # subscription-manager repos --enable "codeready-builder-for-rhel-8-${ARCH}-rpms"
    • on CentOS 8 it is recommended to also enable the PowerTools repository since EPEL packages may depend on packages from it:
      # dnf config-manager --set-enabled PowerTools

Centos 6 error message using epel "Cannot retrieve metalink for repository: epel. Please verify its path and try again"

As a solution, uncomment the third line of the /etc/yum.repos.d/epel.repo file and comment out the fourth line.

  1. open file /etc/yum.repos.d/epel.repo

    [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
  2. Modify it to:

    [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
  3. Clean and reinstall your package

    # yum clean all
    # yum install -y "your package"

If that doesn’t work, modify DNS

  1. Open the /etc/resolv.conf file and add the following:

    nameserver 8.8.8.8
    search localdomain
  2. Then restart the network service

    # service network restart
0 0 votes
Article Rating
赞(0) 打赏
未经允许不得转载:iemblog » How to enable EPEL repository on Centos
Subscribe
Notify of
guest

0 COMMENTS
Inline Feedbacks
View all comments
免责声明:本站大部分下载资源收集于网络,只做学习和交流使用,版权归原作者所有,请在下载后24小时之内自觉删除,若作商业用途,请购买正版,由于未及时购买和付费发生的侵权行为,与本站无关。本站发布的内容若侵犯到您的权益,请联系站长删除,我们将及时处理! Disclaimer: Most of the download resources on this site are collected on the Internet, and are only used for learning and communication. The copyright belongs to the original author. Please consciously delete within 24 hours after downloading. If you use it for commercial purposes, please purchase the original version. If the content posted on this site violates your rights, please contact us to delete it, and we will deal with it in time!

联系我们 Contact us

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

0
Would love your thoughts, please comment.x
()
x