3
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?

Update

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]!

asked Apr 9, 2019 at 18:23
7
  • These instructions usually work for me on ubuntu/linux mint: trac.osgeo.org/postgis/wiki/UsersWikiPostGIS24UbuntuPGSQL10Apt Commented Apr 9, 2019 at 18:50
  • I'd seen a posting of yours similarly beforehand & used as an indicator. Tried anew and same errors. Commented Apr 9, 2019 at 19:08
  • I'll have to do another test... Commented Apr 9, 2019 at 20:15
  • did another few tests and found the hiccup Commented Apr 10, 2019 at 7:26
  • glad the instructions still work!! Commented Apr 10, 2019 at 14:36

2 Answers 2

2

Unmet Dependencies

The UbuntuGIS Quickstart Guide lists a few things that need to be done before installing their packages (these packages include PostGIS).

The first is that your /etc/apt/sources.list must include the "universe" and "multiverse" repositories. Edit that file to add them. There should already be a line that lists "main". In the end, it will look like this:

deb http://archive.ubuntu.com/ubuntu bionic main 
deb http://archive.ubuntu.com/ubuntu bionic-security main 
deb http://archive.ubuntu.com/ubuntu bionic-updates main 
deb http://us.archive.ubuntu.com/ubuntu/ bionic main universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ bionic-security main universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main universe multiverse

This is where all of your dependencies come from.

Install Repository

After that, you need to install the UbuntuGIS repository

sudo add-apt-repository ppa:ubuntugis/ppa

Once this is done, you should be able to install postgis in the typical way:

sudo apt install postgis

Note: there will be a lot of items to install.

answered Apr 15, 2020 at 14:42
0

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'
answered Apr 10, 2019 at 8:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.