1

I have installed PostgreSQL on Ubuntu 18.04 using these instructions: https://computingforgeeks.com/install-postgresql-12-on-ubuntu/

Now I'm trying to install PostGIS extension:

sudo apt install postgis postgresql-12-postgis-3

and I'm getting the following error:

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 was installed sometime earlier. I checked gdal version like this:

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

Also, I tried installing libgdal-dev but it says it is already newest version:

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).

How can I solve this?

1 Answers1

0

libgdal20 (2.2.3+dfsg-2) is available from universe repository:

sudo add-apt-repository universe
sudo apt update

The postgis package is available from postgresql repository and depend on libgdal20 provided by the universe repository.

GAD3R
  • 3,507
  • postgis is also from the universe repository, but it doesn't return an unable to locate error message. – karel Apr 28 '21 at 23:31
  • @karel the postgis package is available from postgresql repository and depend on libgdal20 from universe. – GAD3R Apr 28 '21 at 23:44
  • @karel see http://apt.postgresql.org/pub/repos/apt/pool/main/p/postgis/ . You can reproduce the error by enabling postgresql repository and disabling universe. – GAD3R Apr 28 '21 at 23:49