When executing this command
sudo apt-get install postgresql-9.4-postgis2.1 pgadmin3
to 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 installed
The only solutions I could find online are related to Ubuntu 12 and are outdated, but maybe here knows how to fix this?
As you, I couldn't install
postgresql-9.4-postgis2.1
package but, a while after, I could installpostgresql-9.3-postgis2.1
withpostgis-2.1
andlibgal1h
(Ubuntu version ofgdal
). See below images:The broken dependencies were definitively solved:
As you can see, the
postgis
extension was efectively created forbrasil_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
andpostgis-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:
http://askubuntu.com/questions/84753/what-is-the-easiest-way-to-install-postgis
) 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
http://ppa.launchpad.net/ubuntugis/ppa/
repositories (as stated on github link, issue is ubuntugis is not supported on trusty so need to remove it as an option). Install with samesudo apt-get install postgresql-9.3-postgis-2.1
command 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!