Sajid Ahmad
Sajid Ahmad

Reputation: 1144

error: Please install the PostgreSQL server development packages and re-run configure

I am trying to install the Postgis on my ubuntu system for django framework. But everytime when i run the command ./configure it gives me error

 error: the PGXS Makefile /usr/lib/postgresql/9.3/lib/pgxs/src/makefiles/pgxs.mk cannot be found. Please install the PostgreSQL server development packages and re-run configure.

I have already installed postgres on my system and has also created the user. But i am unable to install the Postgis on my system. I have gone through the many instructions i found on Internet but failed to install it.

Please tell me the solution of this error so that i can install Postgis on ubuntu. help will be highly appreciated

Upvotes: 6

Views: 9846

Answers (4)

Sadegh-khan
Sadegh-khan

Reputation: 2610

just use this command :

sudo apt install postgis

Upvotes: 0

tet
tet

Reputation: 1407

For PostgreSQL 11, you need to install postgresql-11-postgis-2.5 and postgresql-11-postgis-2.5-scripts as described here.

sudo apt install postgresql-11-postgis-2.5
sudo apt install postgresql-11-postgis-2.5-scripts

Upvotes: 0

Craig Ringer
Craig Ringer

Reputation: 324531

Assuming you're using PostgreSQL from http://apt.postgresql.org/ :

apt-get install postgresql-server-dev-9.3

While you're at it, as @BurhanKhalid points out, you should just be installing PostGIS from packages, rather than from source, as the PostGIS web page explains:

apt-get install postgis2_93

Upvotes: 9

Imran Tufail
Imran Tufail

Reputation: 490

Install postgreSql

sudo apt-get install postgresql postgresql-contrib

Install Postgis.

sudo add-apt-repository ppa:gwibber-daily/ppa
sudo apt-get update
sudo apt-get install postgresql-9.3-postgis-2.1
sudo apt-get install postgresql-server-dev-9.3

create database in Postgresql

createuser -U postgres username -S -D -R
psql -U postgres -c "alter role username with password 'passhere';"
createdb -U postgres -T template_postgis -O username dbname

if you do not have the template_postgis in the postgresql then switch to user postgres and run

sudo su postgres
createdb template_postgis
createlang plpgsql template_postgis

Now for creating the extansions

psql -d dbname -c "CREATE EXTENSION postgis;"
psql -d dbname -c "CREATE EXTENSION postgis_topology;"

Upvotes: 2

Related Questions