Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed PostgreSQL 9.x and PostGIS 1.5/2.0 several times and have never had this problem.

I just got a new CentOS 6.3 server up and running and and I have Postgres 9.3 functioning as expected. I have run

yum install postgis2_93

and I can see the files in


however, when I run


I receive

ERROR:  could not open extension control file "/usr/pgsql-9.3/share/extension/postgis.control": No such file or directory

the tutorials (#1, #2) I have used don't show any steps between installing PostGIS and creating the extension.

What am I missing?

share|improve this question
What you're missing is 'postgis.control' :) The question is 'why' or 'where'. First, see if you even have a copy by running 'find /usr -name postgis.control'. If you don't, then it's a packaging problem with the brand new postgis2_93 package that needs to be fixed. – Paul Ramsey Sep 12 '13 at 17:06
Oh, you can see the files (including 'postgis.control'?) share/contrib, but from the error message pgsql is looking in share/extension. There might have been a change in default extension location from 9.2 to 9.3 that the packager missed. – Paul Ramsey Sep 12 '13 at 17:07
@PaulRamsey - I ran find /usr -name postgis.control and it is not present. I can see some files in share/contrib; however, postgis.control is not among them... what do you suggest I do? wait for a fix, make my own, something else? – losthorse Sep 12 '13 at 17:42
@PaulRamsey - I just verified that is present in /lib does this mean I can just make my own postgis.control file? – losthorse Sep 12 '13 at 18:00
If you can find a postgis.sql file, you can run that into your database (and the spatial_ref_sys.sql file) to manually spatialize your database. Report the missing control file to the packager, that's a big problem. – Paul Ramsey Sep 13 '13 at 16:42
up vote 4 down vote accepted

If you can find a postgis.sql file, you can run that into your database (and the spatial_ref_sys.sql file) to manually spatialize your database. Report the missing control file to the packager, that's a big problem.

share|improve this answer

I just had the same problem on Ubuntu Server 14.04. I installed postgis extension from the official Ubuntu repositories using apt-get install postgis.

Then, find /usr -name postgis.control didn't return any results.

The reason was extension/postgis.control wasn't installed because postgis-scripts wasn't.

$ aptitude search postgis
i   libpostgis-java                                  - Geographic objects support for PostgreSQL -- JDBC support 
i   postgis                                          - Geographic objects support for PostgreSQL                 
p   postgis:i386                                     - Geographic objects support for PostgreSQL                 
i   postgis-doc                                      - Geographic objects support for PostgreSQL -- documentation
i   postgresql-9.3-postgis-2.1                       - Geographic objects support for PostgreSQL 9.3             
p   postgresql-9.3-postgis-2.1:i386                  - Geographic objects support for PostgreSQL 9.3             
i   postgresql-9.3-postgis-2.1-scripts               - PostGIS for PostgreSQL 9.3 -- scripts -- dummy package    
i   postgresql-9.3-postgis-scripts                   - Geographic objects support for PostgreSQL 9.3 -- scripts 

The solution is to install it.

On debian like distros:

apt-get install postgis*

The aptitude package manager will automatically determine the correct package versions to install. The postgis-doc will be installed too.

You can check the success of the operation by running the following command:

find /usr -name postgis.control

On my server, it now returns:


You can now enable the extension on any database on your postgres server:

  • connect to your db with superuser (postgres by default)
  • run CREATE EXTENSION postgis;

Your public schema now contains all postgis objects and functions.

share|improve this answer
...wish you had Windows direction too – CodyBugstein Sep 10 '14 at 14:38
...never mind! Solved it in Windows by reinstalling PostGIS via StackBuilder – CodyBugstein Sep 10 '14 at 14:48
Thanks this fixed my Ubuntu problem! The "postgis*" gets a bunch of stuff you don't need. I think "apt-get install postgis postgresql-9.3-postgis-2.1" is sufficient. – Nelson Dec 2 '14 at 19:15
You're probably right. In my case, a full install was preferable but it doesn't the rule. – Rémi B. Dec 3 '14 at 8:35
"apt-get install postgis*" rules. Thanks! – nemesisdesign Jun 6 '15 at 18:23

In Ubuntu 14.04 you also need to install the postgresql-9.3-postgis-scripts package. After I ran

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

I was then able to successfully run


in my database to initialise PostGIS.

share|improve this answer

I encountered the same problem, I think the problem is that the package postgis2_93 is not installed in the expected place as postgresql would expect. You can try using another repo, which might give you the correct place. Or you can search to add extensions manually by specifying the place. In my case, the file is in /usr/pgsql-9.4/

share|improve this answer

If you are using brew, uninstall PostGIS and reinstall it. This will create the extension files.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.