Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 747
Sajid Ahmad Avatar asked Oct 01 '14 05:10

Sajid Ahmad


People also ask

How do you check if Postgres is installed?

Check Postgres Version from SQL Shell Type the following SQL statement within the prompt to check the current version: SELECT version(); The resulting output provides the full version and system information for the PostgreSQL server.

Where is Postgres installed in Ubuntu?

Now I can understand why postgresql. conf and other configuration files are stored in /etc/postgresql/9.3/main. After all, /etc is where configuration files are stored in a linux system.


2 Answers

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
like image 102
Craig Ringer Avatar answered Oct 04 '22 00:10

Craig Ringer


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;"
like image 25
Imran Tufail Avatar answered Oct 04 '22 00:10

Imran Tufail