Error installing PostGis on Debian

Hi, I am installing PostGis on top of psql on a Debian machine (actually crunchbang).

I have completed the following steps:

$ wget http://download.osgeo.org/postgis/source/postgis-2.0.3.tar.gz $ tar xzf postgis-2.0.3.tar.gz $ cd postgis-2.0.3 $ ./configure 

In the last step, I get the following error:

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

The problem is that I already have postgres installed:

 $ psql --version psql (9.1.9) 

I checked this on two machines with the same configuration and got the same error. What am I missing here?

+3
source share
2 answers

PostgreSQL is broken into several packages, and installing psql does not mean that development packages are also installed.

According to the error message:

Please install PostgreSQL server development packages and restart Setup

you need:

 # apt-get install postgresql-server-dev-9.1 

Also take a look at the APT pgdg repository , providing the latest pre-compiled versions of postgres-related packages (including postgis) that you can use instead of self-compiling.

If your system is configured to use this repository, simply do:

 # apt-get install postgresql-9.1-postgis-2.0 
+8
source

Daniel's answer works fine, except that he needs the following update:

 $ sudo apt-get install postgresql-9.1-postgis-2.1 

These packages may be updated in the future again. Therefore, it is recommended that you search for new packages using aptitude and install the appropriate one:

 $ aptitude search postgis 
0
source

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


All Articles