在Ubuntu 16.04 Xenial上安装PostGIS

时间:2016-12-20 12:16:26

标签: postgresql postgis ubuntu-16.04

我想在Ubuntu xenial 16.04上使用PostgreSQL 9.6安装PostGIS 2.3:

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

然后安装postgis:

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

但是这会回来:

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 个答案:

答案 0 :(得分:0)

我知道它有点晚了但是对于那些遇到这个问题的人,试试吧 使用16.04

时设置xenial-pgdg而不是trusty-pgdg
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