Install PostGIS on Ubuntu 16.04 Xenial

2.3k Views Asked by At

I want to install PostGIS 2.3 with PostgreSQL 9.6 on a Ubuntu xenial 16.04 with:

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt trusty-pgdg main" >> /etc/apt/sources.list'
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update

Then install postgis:

sudo apt-get install postgresql-9.6-postgis-2.3

But this returns:

The following packages have unmet dependencies:

postgis : Depends: libgdal1h (>= 1.9.0) but it is not installable
          Depends: libgeos-c1 (>= 3.4.2) but it is not installable
          Depends: liblwgeom-2.3-0 (>= 2.0.0) but it is not going to be installed
1

There are 1 best solutions below

0
atom On

I know it's a bit later but for those who get this problem, try setting xenial-pgdg instead of trusty-pgdg when using 16.04

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt xenial-pgdg main" >> /etc/apt/sources.list' 
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - 
sudo apt-get update