8

I need to install some tools from the Extra Packages for Enterprise Linux repository (EPEL) that are not available in the default repositories of the Amazon Linux AMI. /etc/yum.repos.d/epel.repo already contains the needed repository, but it is disabled. This is mentioned by Amazon in their FAQ.

Can I enable this repo (i.e. change enabled=0 to enabled=1) from a configuration file in my .ebextensions directory or similar? Not surprisingly, I need the change to persist between different instances and environments, so changing it manually is not enough.

lime
  • 181
  • 1
  • 3
  • 2
    I'm very surprised that they have that in there at all. EPEL is not guaranteed to be compatible with Amazon Linux, and [for many packages it is not](http://serverfault.com/q/601460/126632). – Michael Hampton Jul 18 '14 at 15:04
  • Good point, and obviously I will have to tread carefully. :) Luckily in my case, the tools are non-essential and I can leave out those that happen to be incompatible. – lime Jul 18 '14 at 15:33
  • You can enable a repo for only the current command, `yum --enablerepo=epel install some-package`. This requires no changes to the system and doesn't leave a repository enabled that might latter cause problems. – Brian Jul 18 '14 at 17:09
  • @MichaelHampton I believe support for EPEL may have changed. In any case, I've installed git dozens of times on EC2 instances and never ran into the problem you linked to. So I would imagine that there is another reason for the error. – Jordan Reiter Jun 20 '16 at 19:31

1 Answers1

4

extending Brian's comment - something like this in your .config

packages:
  yum:
    git: []
    postgresql93-devel : []
    geos: []

commands:
  01_gdal:
    command: "yum --enablerepo=epel -y install gdal"
Philip Pearl
  • 141
  • 3
  • 1
    Not quite, packages are executed before commands, so this would fail. – danieljimenez Feb 16 '17 at 20:00
  • @danieljimenez no, this would not necessarily fail; this .config results in installing a single package (gdal) from epel. If the rest of the packages may be installed without epel then the order doesn't matter. This answer is the simplest if you just want to install a single package from epel. – JDiMatteo May 22 '18 at 13:17