4

I have installed the newest epel and want to install mod_evasive

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

Uname -a:
    Linux  #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

yum repolist:
    Loaded plugins: fastestmirror, protectbase, security
    Loading mirror speeds from cached hostfile
     * base: mirror.amsiohosting.net
     * extras: mirrors.supportex.net
     * rpmforge: mirror.nl.leaseweb.net
     * updates: mirror.nl.leaseweb.net
    0 packages excluded due to repository protections
    repo id                        repo name                                         status
    base                           CentOS-6 - Base                                   6,503+72
    extras                         CentOS-6 - Extras                                       48
    rpmforge                       RHEL 6 - RPMforge.net - dag                       4,663+55
    updates                        CentOS-6 - Updates                                  917+41
    repolist: 12,131

yum --disablerepo="*" --enablerepo="epel" search mod_evasive:
    Loaded plugins: fastestmirror, protectbase, security


Error getting repository data for epel, repository not found

mod was excluded in conf but I already removed that from /etc/yum.conf

3

This means the repo "epel" was not configured. The first command evidently failed:

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

This should place a file at /etc/yum.repos.d/epel.repo, with a first line:

[epel]

That first line is the name of the repo, so if you don't see it, it's not there.

Try downloading the file first -- just paste the URL into the address bar of a browser:

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

And work from there by installing it:

sudo rpm -ivh epel-release-6-8.noarch.rpm

The package enables the epel repo by default, so you shouldn't have to say --disablerepo='*' --enablerepo=epel (note my difference of opinion on quotes).

  • By the way, rpm tells me rpm: RPM should not be used directly install RPM packages, use Alien instead! when I try to run sudo rpm – Timothy Swan Oct 11 '17 at 16:10
  • @TimothySwan - The fact you're getting an error from alien suggests you're using a non-Red Hat OS. All Red Hat OSs use rpm as the backend package format; with either yum or dnf for the frontend package delivery mechanism. Your system has something else on the backend and frontend; e.g. deb packages delivered by apt in Ubuntu. In other words this question about CentOS and EPEL does not apply to your situation. Hope that helps! – Rich Oct 17 '17 at 20:52
2

Rich's answer was frightening me so I wanted to find an official CentOS answer. Here it is, and its only one command. Huzzah!

yum --enablerepo=extras install epel-release

Extra Packages for Enterprise Linux (EPEL) - (See http://fedoraproject.org/wiki/EPEL) provides rebuilds of Fedora packages for EL6 and EL7. Packages should not replace base, although there have been issues around point releases in the past. You can install EPEL by running yum --enablerepo=extras install epel-release. The epel-release package is included in the CentOS Extras repository that is enabled by default. Support available on Freenode in #epel, on mailing lists, and its issue tracker. If you are willing to help test EPEL updates before they are pushed to stable, you can enable the epel-testing repository on your development/testing servers. Enabling epel-testing on production systems is not a good idea.

  • Can not agree more that answer with specific versions and so much details looks like trouble answer and one command is just what need as answer :) I wish all problems in life can have simple answer. – user2153517 Apr 23 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.