Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 937
user2950747 Avatar asked Apr 21 '16 14:04

user2950747


People also ask

Where can I get updates for the Amazon Linux AMI?

Amazon Web Services provides ongoing security and maintenance updates to all instances running the Amazon Linux AMI.

What is the package installer recommended by Amazon Linux?

Amazon Linux instances manage their software using the yum package manager. The yum package manager can install, remove, and update software, as well as manage all of the dependencies for each package.


2 Answers

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

like image 109
python1981 Avatar answered Sep 28 '22 09:09

python1981


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.

like image 25
Abel Callejo Avatar answered Sep 28 '22 10:09

Abel Callejo