使用 GDAL 3.0.4 安装 PostGIS

使用 GDAL 3.0.4 安装 PostGIS

我已按照以下说明在 Ubuntu 18.04 上安装了 PostgreSQL:https://computingforgeeks.com/install-postgresql-12-on-ubuntu/

现在我正在尝试安装 PostGIS 扩展:

sudo apt install postgis postgresql-12-postgis-3

我收到以下错误:

The following packages have unmet dependencies:
 postgis : Depends: libgdal20 (>= 2.0.1) but it is not going to be installed
 postgresql-12-postgis-3 : Depends: libgdal20 (>= 2.0.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

GDAL 是在早些时候安装的。我检查了 gdal 版本,如下所示:

gdalinfo --version
GDAL 3.0.4, released 2020/01/28

另外,我尝试安装 libgdal-dev,但它说它已经是最新版本:

sudo apt install libgdal-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libgdal-dev is already the newest version (3.0.4+dfsg-1~bionic0).

我该如何解决这个问题?

答案1

libgdal20 (2.2.3+dfsg-2)可从universe存储库获取:

sudo add-apt-repository universe
sudo apt update

postgis包可从 postgresql 存储库获得,并依赖libgdal20于 universe 存储库提供。

相关内容