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]!
-
These instructions usually work for me on ubuntu/linux mint: trac.osgeo.org/postgis/wiki/UsersWikiPostGIS24UbuntuPGSQL10AptInactivated Account– Inactivated Account2019年04月09日 18:50:06 +00:00Commented Apr 9, 2019 at 18:50
-
I'd seen a posting of yours similarly beforehand & used as an indicator. Tried anew and same errors.Jerome– Jerome2019年04月09日 19:08:10 +00:00Commented Apr 9, 2019 at 19:08
-
I'll have to do another test...Inactivated Account– Inactivated Account2019年04月09日 20:15:20 +00:00Commented Apr 9, 2019 at 20:15
-
did another few tests and found the hiccupJerome– Jerome2019年04月10日 07:26:29 +00:00Commented Apr 10, 2019 at 7:26
-
glad the instructions still work!!Inactivated Account– Inactivated Account2019年04月10日 14:36:33 +00:00Commented Apr 10, 2019 at 14:36
2 Answers 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.
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'