I am trying to install fail2ban on our Amazon EC2 Linux AMI (CentOS). I know that fail2ban is in the EPEL so I have done the following:

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

However, when I do that I get the following message:

package epel-release-6-8.9.amzn1.noarch (which is newer than epel-release-6-8.noarch) is already installed

Which implies to me that EPEL is already available but if I do:

sudo yum install fail2ban

I get:

Loaded plugins: priorities, security, update-motd, upgrade-helper
amzn-main                                                                                   | 2.1 kB     00:00
amzn-updates                                                                                | 2.3 kB     00:00
Setting up Install Process
No package fail2ban available.
Error: Nothing to do

I assume that I am misunderstanding something but how can I install from EPEL?

EDIT: I have just done the following and found that the repo is not enabled:

yum repolist all

SO how do I enable a repo on EC2?

  • 2
    OK so I am not allowed to answer my own question yet but solved it with: yum-config-manager --enable epel
    – williamsdb
    Apr 8, 2013 at 9:05

3 Answers 3


You should check that epel is enabled using

yum repolist enabled

If it's not then you can edit /etc/yum.repos.d/epel.repo and change the [epel] section




or use

 yum-config-manager --enable epel
  • 5
    OMG I LOVE YOU SO MUCH. Oct 4, 2013 at 0:57
  • 1
    @yellottyellott I too, share mutual love for this random Internet stranger.
    – Pkmmte
    Apr 12, 2021 at 16:14

The epel repo is on the default Amazon server but in not enabled by default. You can use it to install a package:

sudo yum --enablerepo epel install fail2ban

Update for Amazon Linux 2:

sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm


sudo amazon-linux-extras install epel -y


sudo amazon-linux-extras enable epel
sudo yum install -y epel-release

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.