2014-01-15 84 views
3

您好我正在通過psql在Debian機器上安裝PostGis(實際上是crunchbang)。在Debian上安裝PostGis時出錯

我已經完成以下步驟:

$ 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 

在最後一步,我得到以下錯誤:

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. 

的問題是,我已經安裝的Postgres:

$ psql --version 
psql (9.1.9) 

我已經在兩臺機器上檢查過相同的配置,並得到相同的錯誤。我在這裏錯過了什麼?

+0

以下是一些有用的指示:http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS20Debian70src –

回答

8

PostgreSQL被分解爲幾個包,安裝了psql並不意味着安裝了開發包。

根據錯誤信息:

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

你需要:

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

還要注意有一個APT pgdg repository提供的Postgres的相關的軟件包(包括了PostGIS)近期預編譯的版本,你可以使用而不是自編譯。

如果您的系統設置爲使用這個倉庫,只是做:

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

有一個'' 'postgresql-9.3-postgis-2.1'''現在。我多麼希望我早點知道這個回購的存在:/ – amenadiel

0

除了它需要以下更新丹尼爾的回答的偉大工程:

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

這些軟件包可以更新一些再次在未來的時間。因此,建議尋找使用aptitude新的軟件包,並安裝相應的一個:

$ aptitude search postgis