13

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?

williamsdb
  • 483
  • 1
  • 7
  • 17
  • 2
    OK so I am not allowed to answer my own question yet but solved it with: yum-config-manager --enable epel – williamsdb Apr 08 '13 at 09:05

3 Answers3

25

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

enabled=0

to

enabled=1

or use

 yum-config-manager --enable epel
user9517
  • 114,104
  • 20
  • 206
  • 289
4

Update for Amazon Linux 2:

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

Or,

sudo amazon-linux-extras install epel -y

Or,

sudo amazon-linux-extras enable epel
sudo yum install -y epel-release
Amit Naidu
  • 774
  • 5
  • 11
3

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
Zags
  • 131
  • 3