When executing this command
sudo apt-get install postgresql-9.4-postgis2.1 pgadmin3to install PostgreSQL with PostGIS I get the following error:
postgresql-9.4-postgis-2.1 : Depends: libgdal1 (>= 1.9.0) but it is not going to be installedThe only solutions I could find online are related to Ubuntu 12 and are outdated, but maybe here knows how to fix this?
12 Answers
As you, I couldn't install postgresql-9.4-postgis2.1 package but, a while after, I could install postgresql-9.3-postgis2.1 with postgis-2.1 and libgal1h (Ubuntu version of gdal). See below images:
The broken dependencies were definitively solved:
As you can see, the postgis extension was efectively created for brasil_estados database.
It is not totally functional. Next time that you open Synaptic, the packages appear as broken dependencies. It's impossible to upgrade the system with postgresql-9.3-postgis2.1 and postgis-2.1 installed.
I also had problems installing PostGIS on Ubuntu 15.04, but eventually got it to work. I tried a few different things (eg, this easy looking example for earlier version of Ubuntu: ) so not sure what all will be relevant, but here are the steps that worked for me:
try installing postgresql-9.3-postgis-2.1 with
sudo apt-get install postgresql-9.3-postgis-2.1(NOTE: it looks like postgresql-9.4 does not yet have postgis for ubuntu 15.04, as seen withapt-cache search postgresql-9)(If you DO NOT get an error skip step 3) assuming you get an error like "missing dependency... libgdal1 will not be installed" then go find your sources.list in /etc/apt as mentioned on this github issue and remove any repositories (as stated on github link, issue is ubuntugis is not supported on trusty so need to remove it as an option). Install with same
sudo apt-get install postgresql-9.3-postgis-2.1command and ideally you'll get no errors...Test connection to postgresql with 'psql' (NOTE: may need to set connection details appropriately, see psql options)
Confirm you can add postgis with 'CREATE EXTENSION postgis;' in psql, view added extensions with '\dx'
Hope this helps!