2

I've installed PostgreSQL v9.3 (database) on Ubuntu 14.04 and I'm currently attempting to install the following:

sudo apt-get install postgresql-9.3-postgis-2.1

However I'm getting the following error:

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

Please Note: I have already successfully installed the following:

sudo apt-get install postgresql-9.3 
sudo apt-get install postgresql-contrib-9.3 
sudo apt-get install postgresql-9.3-postgis-2.1-scripts

How can I solve this?

Oudin
  • 201
  • if you try sudo apt-get install -f what happens? – Thomas Ward Jun 13 '15 at 18:48
  • sudo apt-get install -f postgresql-9.3-postgis-2.1 produces the same error postgresql-9.3-postgis-2.1 : Depends: libgdal1 etc... – Oudin Jun 13 '15 at 19:48
  • The versions required seem odd, e.g.liblwgeom-2.1.7 (>= 2.1.6), when the version of liblwgeom is 2.1.2 in the standard 14.04 repostiories. Starting from a standard postresql 9.3, postgis may be installed, and it pulls in the 2.1.2 version of liblwgeom, but then trying to install postgresql-9.3-postgis-2.1 results in a need to reinstallation of postgres-9.3! What repositories are you using? – ubfan1 Jun 14 '15 at 18:03
  • Under Ubuntu Software tab, enable all the repositories We are not all running ubuntu with a UI. So I can't follow your answer with software-properties-gtk. Moreover, you may have added some repositories by yourself before. Can you give the list of repositories do you have enabled ? – etrimaille Jul 16 '15 at 15:41

2 Answers2

1

After some additional research I found the answer via the following questions How do I resolve unmet dependencies after adding a PPA? which can be applied to this question as a solution.

In your terminal run

software-properties-gtk

Under Ubuntu Software tab, enable all the repositories

Next run

sudo apt-get update    
sudo apt-get upgrade

Finally run

sudo apt-get install  postgresql-9.3-postgis-2.1

Worked successfully for me I hope this helps someone with the same issue install postgresql-9.3-postgis-2.1 with unmet dependencies on Ubuntu 14.04

Oudin
  • 201
0

I ran into a very similar problem while provisioning an Ubuntu 14.04 box with Vagrant using a configuration that used to work:

The following packages have unmet dependencies:
postgresql-9.3-postgis-2.1 : Depends: libgdal1h (>= 1.9.0) but it is not going to be installed
                             Depends: libgeos-c1 (>= 3.4.2) but it is not going to be installed
                             Depends: liblwgeom-2.1.2 (>= 2.1.2) but it is not going to be installed

It turns out there was a conflict with the official Ubuntu repository and the Postgresql.org repository and ubuntugis ppa. Not adding those repositories as sources when provisioning the box fixed the issue for me.