sudo apt-get install postgresql-9.5-postgis-2.5

returns a series of errors:

The following packages have unmet dependencies:
postgresql-9.5-postgis-2.5 : 
  Depends: libgdal1i (>= 1.9.0) but it is not installable
  Depends: libjson-c2 (>= 0.11) but it is not installable
  Depends: liblwgeom-2.5-0 (>= 2.5.0~beta1) but it is not going to be installed
  Depends: libproj9 (>= 4.9.0) but it is not installable
  Depends: libsfcgal1 (>= 1.2.0) but it is not installable

E: Unable to correct problems, you have held broken packages.

I had never encountered a not installable exception to date so I ma not sure of consequences of different possible actions... Attempting lower versions leads to the same result. How can PostGIS get safely installed then?


An attempt was also made, making a fresh installation of a Ubuntu 18.04 VM [following these instructions][1]

The source of the error was in adding the repository to sources.list

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt xenial-pgdg main" >> /etc/apt/sources.list'

which should be for 18.04

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt bionic-pgdg main" >> /etc/apt/sources.list'

[to butter things up even more, and attempt was made with bioni-pgdg main leading to its own set of errors]!


Ensure that the proper repository is added to the sources.list

sudo lsb_release -a 

ensure the codename is the same in the add repository command:

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt **Codename**-pgdg main" >> /etc/apt/sources.list'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.