سؤال

I am in the process of installing PostGis over 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

On the final 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 issue is that I do already have Postgres installed:

$ psql --version
psql (9.1.9)

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

هل كانت مفيدة؟

المحلول

PostgreSQL is broken down into several packages, and having psql installed doesn't imply that the development packages are also installed.

According to the error message:

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

you need:

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

Also note there's a APT pgdg repository providing recent pre-compiled versions of postgres-related packages (including postgis) that you may use instead of self-compiling.

If your system is set up to use this repository, just do:

# apt-get install postgresql-9.1-postgis-2.0

نصائح أخرى

Daniel's answer works great except that it needs the following update:

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

These packages can be updated some time in future again. So, it is recommended to search for new packages using aptitude and install the appropriate one:

$ aptitude search postgis
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top