2014-06-27 58 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的 –