Enable the EPEL repository on AWS Elastic Beanstalk

5,283

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"
Share:
5,283

Related videos on Youtube

lime
Author by

lime

Updated on September 18, 2022

Comments

  • lime
    lime almost 2 years

    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.

    • Michael Hampton
      Michael Hampton almost 10 years
      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.
    • lime
      lime almost 10 years
      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.
    • Brian
      Brian almost 10 years
      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.
    • Jordan Reiter
      Jordan Reiter about 8 years
      @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.
  • danieljimenez
    danieljimenez over 7 years
    Not quite, packages are executed before commands, so this would fail.
  • JDiMatteo
    JDiMatteo about 6 years
    @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.