How can I install a recent version of GDAL on Amazon Linux?
Asked Answered
Q

2

13

I'd like to install GDAL on an EC2 instance running Amazon Linux (which I think is based on RHEL 6). I'd like to avoid compiling from source if possible.

The version of GDAL included in the EPEL Yum repository is too old for my purposes (gdal-1.7.3-15.el6.x86_64). EPEL 7 includes gdal-1.11.4-1.el7.x86_64 which would be perfect. Is there any way I could use this repo on Amazon Linux?

So far I've also tried:

  1. Adding GDAL from the ELGIS 6 repo (which has version 1.9.2). However this failed to install – as found / by others. The ELGIS Wiki advises people to use EPEL now anyway.
  2. Downloading and installing the more recent GDAL RPM from EPEL 7, but it fails due to mismatches between GDAL's dependencies and the available packages in my enabled repos.

I'm not at all experienced with Amazon Linux (or Yum) so any hints much appreciated.

Quintie answered 21/4, 2016 at 14:6 Comment(3)
FWIW I couldn't find a simple solution and have migrated to Ubuntu 14.04, which has GDAL 1.10.1 via apt-get. This question pointed to https://pkgs.org/ which is super helpful when choosing a distro by the available versions of managed packages.Quintie
Did you ever find an answer to this question? I'm having a similar problem and since I'm using Elastic Beanstalk, Amazon Linux is my only choice (unless I want to roll my own Docker image which I'd rather not do at this time).Haitian
Sorry, no. There's a few people asking AWS for it. Good luck!Quintie
T
9

This worked for me.

sudo yum -y update
sudo yum-config-manager --enable epel
sudo yum -y install make automake gcc gcc-c++ libcurl-devel proj-devel geos-devel
cd /tmp
curl -L http://download.osgeo.org/gdal/2.0.0/gdal-2.0.0.tar.gz | tar zxf -
cd gdal-2.0.0/
./configure --prefix=/usr/local --without-python
make -j4
sudo make install
cd /usr/local
tar zcvf ~/gdal-2.0.0-amz1.tar.gz *

From https://gist.github.com/mojodna/2f596ca2fca48f08438e

Tom answered 4/7, 2017 at 13:29 Comment(3)
FWIW, if you choose the Elastic Beanstalk Python 3.7 image, EPEL does not have geos-devel nor gdal anymore, so it is a real pain to install manually. The only option I see is to forget about simple python deployment and go for Docker... :(Trashy
Very useful answer. Related thread: #70276065Malherbe
Amazon Linux 2 doesn't support epel anymoreElfland
D
5

I faced the same problem. It is quite a bit challenging to install with yum.

Required packages

Using yum, you can install GDAL's required packages:

  • cpp
  • sqlite3
  • libtiff
  • cmake3

like so:

sudo yum install cpp.x86_64 sqlite-devel.x86_64 libtiff.x86_64 cmake3.x86_64

PROJ and GDAL

These two have to be installed from source (tarball) and they also depend on the build you want.

As for me, I was able to install GDAL 3.2.1 on Amazon Linux 2. I also have not tried installing it on an Amazon Linux 1 so it may or may not differ.

Dioptrics answered 2/11, 2020 at 23:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.