2014-06-27 73 views
2

在試圖按照the docs安裝GeoDjango時,我遇到了一些包依賴性問題。我使用布料,但我懷疑這是相關的。我的理解是,它成功完成fabtools.require.deb.install('binutils libproj-dev gdal-bin python-gdal libgeoip1')後,我應該能夠安裝POSTGIS,嘗試以下的輸出:安裝GeoDjango - postGIS包破壞

[localhost] sudo: DEBIAN_FRONTEND=noninteractive apt-get install --quiet --assume-yes postgresql-9.3-postgis-2.1 
[localhost] out: Reading package lists... 
[localhost] out: Building dependency tree... 
[localhost] out: Reading state information... 
[localhost] out: Some packages could not be installed. This may mean that you have 
[localhost] out: requested an impossible situation or if you are using the unstable 
[localhost] out: distribution that some required packages have not yet been created 
[localhost] out: or been moved out of Incoming. 
[localhost] out: The following information may help to resolve the situation: 
[localhost] out: 
[localhost] out: The following packages have unmet dependencies: 
[localhost] out: postgresql-9.3-postgis-2.1 : Depends: libgdal1 (>= 1.9.0) but it is not going to be installed 
[localhost] out:        Recommends: postgis but it is not going to be installed 
[localhost] out: E: Unable to correct problems, you have held broken packages. 

這是從文檔本身的偏差,但使用postgresql-9.3-postgis如在文檔結果表明:這個錯誤:

[localhost] sudo: DEBIAN_FRONTEND=noninteractive apt-get install --quiet --assume-yes postgresql-9.3-postgis 
[localhost] out: Reading package lists... 
[localhost] out: Building dependency tree... 
[localhost] out: Reading state information... 
[localhost] out: Package postgresql-9.3-postgis is not available, but is referred to by another package. 
[localhost] out: This may mean that the package is missing, has been obsoleted, or 
[localhost] out: is only available from another source 
[localhost] out: 
[localhost] out: E: Package 'postgresql-9.3-postgis' has no installation candidate 

這似乎更沒有幫助。

這裏有一個小的調查中,我已經做了:

$ dpkg --get-selections | grep hold 
$ dpkg --get-selections | grep gdal 
gdal-bin     install 
libgdal1h     install 
python-gdal     install 
$ apt show libgdal1h 
... 
Replaces: libgdal1 (<= 1.10.0-0~), libgdal1-1.6.0 (<= 1.10.0-0~) 
... 
Breaks: libgdal1 (<= 1.10.0-0~), libgdal1-1.6.0 (<= 1.10.0-0~) 
... 

所以看起來libgdal1h是問題...或PostgreSQL的-9.3-PostGIS的包取決於現在已經過時了包,其中本身被libgdal1h所取代,我猜想,它被包含在第一個安裝的軟件包之一中(如gdal-bin)。但我不知道在哪裏何去何從......

+0

你正在使用哪個Ubuntu版本? 'lsb_release -a' – pztrick

+0

你可以嘗試添加ubuntugis ppa:'apt-add-repository -y ppa:ubuntugis/ppa'。資質應該照顧到依賴關係,所以也許你可以打你的fabtools.require ...行? – pztrick

+0

感謝您的幫助,請看這裏:http://askubuntu.com/questions/490073/postgis-dependency-conflicts-ubuntu-14 – Ben

回答

1

我已經解決了這個問題在Ubuntu只是這個

apt-get install postgresql-9.1-postgis-2.1 postgis-doc 

我想你可以嘗試做

apt-get install postgresql-9.3-postgis-2.1 postgis-doc 

如果你正在使用postgresql-9.3。

+0

或debian試試這個:http://www2.qgis.org/en/網站/ forusers/alldownloads.html#Ubuntu的 –