0

I want to install Postgres 9.X and Postgis for it. I manage to install Postgres with version 9.6 with this command:

sudo apt-get install postgresql-9.6

But then when I type:

sudo apt get install postgis

I suddenly get postgres 10 and postgis for that version.

When I try something like on this link http://technobytz.com/install-postgis-postgresql-9-3-ubuntu.html my installation failed, I get this code in terminal:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

 The following packages have unmet dependencies:
 postgresql-9.3-postgis-2.1 : Depends: libgdal1 (>= 1.9.0) but it is not going to be installed
                          Depends: libgeos-c1 (>= 3.3.3) but it is not going to be installed
                          Depends: liblwgeom-2.1.8 (>= 2.1.6) but it is not going to be installed
                          Depends: libproj0 but it is not installable
                          Recommends: postgresql-contrib-9.3 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I am using Ubuntu 18.04

Neven
  • 453
  • 2
  • 7
  • 14
  • If using Brew, my answer to a similar question (https://stackoverflow.com/a/67632520/1399315) is essentially to follow the steps at https://github.com/CloverHealth/homebrew-tap – cedricdlb May 21 '21 at 07:34

1 Answers1

0

On ubuntu, you can use following commands:

sudo apt-get install postgresql-<xx>-postgis-<yy> postgresql-<xx>-postgis-<yy>-scripts

e.g

sudo apt-get install postgresql-9.6-postgis-2.4 postgresql-9.6-postgis-2.4-scripts

Just choose the proper version you need.

Eric
  • 22,183
  • 20
  • 145
  • 196