I've installed PostgreSQL 9.1 and postgis on Ubuntu Server 13.10 as follows:

sudo add-apt-repository-ppa:ubuntugis/ubuntugis-unstable
apt-get update
apt-get install postgresql-9.1-postgis

then I tried creating some special columns allowed by postgis like a geometry column but that doesn't exist. I did some search and found this https://stackoverflow.com/questions/8459361/postgis-install

so I tried:

CREATE EXTENSION postgis_topology;

but I got this error: could not open extension control file "usr/share/postgresql"

  • Are you the same person as Dan on Stack Overflow? With this question: stackoverflow.com/q/21498244/398670 ? (You know you can sync your accounts between Stack Exchange sites, right, you don't have to make a different one on each site). Feb 2, 2014 at 1:40

5 Answers 5


I've used the following approach for installing postgis:

sudo apt-get install python-software-properties
sudo apt-add-repository ppa:ubuntugis/ppa
sudo apt-get update
sudo apt-get install postgresql-9.1
sudo apt-get install postgresql-9.1-postgis

Are you sure that it all installed without errors?

  • after update command i got this error: E: Some index files failed to download. They have been ignored, or old ones used instead and it's gone when i removed the repository
    – Shadin
    Feb 1, 2014 at 18:40
  • Can you try and run apt-get update --fix-missing to see if something was not downloaded/installed properly ?
    – djq
    Feb 1, 2014 at 18:51
  • 404 Not found for: W: Faild to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/dists/saucy/main/binary-amd64/Packages and W: Faild to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/dists/saucy/main/binary-i386/Packages
    – Shadin
    Feb 1, 2014 at 19:09
  • ok, looks like the ppa does not exist for this version of ubuntu. I have only tested the above on 12.04
    – djq
    Feb 1, 2014 at 19:13
  • well, if i keep getting this problems i might be back to Ubuntu 12.04
    – Shadin
    Feb 1, 2014 at 19:25

Those instructions seem to be outdated. Please, read this question for a reason of your errors, and for a better install way.

See these links also, for a quick way:

  • When I tried to install postgresql-9.1-postgis-2.0-scripts i get that it's already installed. but couldn't figure out how to activate it or something
    – Shadin
    Feb 1, 2014 at 18:52
  • The tutorial says that now: "... you should be able to connect to a database with psql and be able to run this: create extension postgis; If this works, then you should be good to go!" Feb 1, 2014 at 18:59
  • when I run psql -U postgres -c "CREATE EXTENSION postgis" I get: ERROR: could not open extension control file "/usr/sharepostgresql/9.1extension/postgis.control": No such file or directory
    – Shadin
    Feb 1, 2014 at 19:19
  • Then, try to spatially enabling your database using enabler scripts. Follow Enabler Scripts / Template section instructions from here: trac.osgeo.org/postgis/wiki/UsersWikiPostGIS20Ubuntu1204src Feb 1, 2014 at 19:29

For what it's worth, the ubuntugis-stable ppa does not contain a postgis package for saucy.

However, the ubuntugis-unstable ppa does. I install packages from the unstable ppa by default. I feel like the stable ppa is very slow to support the latest versions of ubuntu.


With 13.10 (albeit the desktop version) I found that I had to build PostGIS 2.x from source, as the ubuntugis-unstable PPA does not include the *.sql scripts necessary to register the extension in and populate a template database (I think mattmakesmaps alluded to this in his answer). Here are the basic steps for building PostGIS 2.1 from source on top of PostgreSQL 9.1. This approach assumes that you installed PostgreSQL 9.1 from the package (postgresql-9.1) and also installed GEOS, Proj, and GDAL form source or can otherwise find the shared libraries.

# Install dependencies
sudo apt-get install libxml2-dev

cd /usr/local/ && sudo mkdir postgis && sudo chown [username] postgis && cd postgis
wget http://download.osgeo.org/postgis/source/postgis-2.1.0.tar.gz
tar -xzvf postgis-2.1.0.tar.gz && rm postgis-2.1.0.tar.gz && cd postgis-2.1.0
sudo ./configure --with-projdir=/usr/local/proj/proj-4.8.0/
sudo make install

# Configure template database
sudo su -c "createdb $POSTGIS_TEMPLATE" - postgres 
sudo -u postgres psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='$POSTGIS_TEMPLATE';" 
sudo -u postgres psql -d $POSTGIS_TEMPLATE -f /usr/share/postgresql/$POSTGRESQL_VER/contrib/postgis-2.1/postgis.sql
sudo -u postgres psql -d $POSTGIS_TEMPLATE -c "GRANT ALL ON geometry_columns TO PUBLIC;"
sudo -u postgres psql -d $POSTGIS_TEMPLATE -c "GRANT SELECT ON spatial_ref_sys TO PUBLIC;"

If you want to install shp2pgsql you'll need to do the following.

# Put the loader `shp2pgsql` on your path; likely not done when building from source
cd /usr/local/postgis/postgis-2.1.0/loader
sudo make install
sudo ln -s /usr/local/postgis/postgis-2.1.0/loader/shp2pgsql /usr/local/bin/shp2pgsql

Check the install instructions found here:


I've had no problem with these on Ubuntu 12.04, 12.10, 13.04, 13.10, and even Cinnamon Mint!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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