Ubuntu – Enable PostGIS extension on Ubuntu 14.04.2

postgresql

I have troubles enabling PostGIS extension on Ubuntu 14.04.2 and PostgreSQL 9.3. I have installed the packages with this step by step procedure.

PostgreSQL and pgAdminIII seem to be installed properly. I can launch pgAdminIII and the localhost default server exists. I add a new DB and type in CREATE EXTENSION postgis;. I get the following error:

ERROR:  could not open extension control file "/usr/share/postgresql/9.3/extension/postgis.control": Aucun fichier ou dossier de ce type

Could anyone help? I think I'm not far from success…

Thanks a lot!

Best Answer

You must install postgis and postgresql-9.3-postgis-2.1 packages and create postgis extension on your database

sudo apt-get install postgis postgresql-9.3-postgis-2.1
sudo -u postgres psql -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;" DATABASE_NAME_HERE

Reference: Jon Saints' Tutorial

Related Question