Error: Install PostgreSQL server development packages and restart configure

I am trying to install Postgis on my ubuntu system for django framework. But every time I run a command. / configure, it gives me an 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 already installed postgres on my system and also created a user. But I can not install Postgis on my system. I looked through a lot of the instructions that I found on the Internet, but could not install them.

Please tell me the solution to this error in order to install Postgis on ubuntu. help would be much appreciated

+5
source share
2 answers

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

 apt-get install postgresql-server-dev-9.3 

As long as you see it, as @BurhanKhalid points out, you should just install PostGIS from packages, not from the source, as the PostGIS webpage explains

 apt-get install postgis2_93 
+8
source

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 a 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 don't have a postgis template in postgresql then switch to postgres and run

 sudo su postgres createdb template_postgis createlang plpgsql template_postgis 

Now to create extensions

 psql -d dbname -c "CREATE EXTENSION postgis;" psql -d dbname -c "CREATE EXTENSION postgis_topology;" 
+2
source

Source: https://habr.com/ru/post/1203765/


All Articles