安装GeoDjango - postGIS包坏了

时间:2014-06-27 19:46:32

标签: ubuntu postgis geodjango apt deb

在按the docs尝试安装GeoDjango时,我遇到了一些包依赖问题。我正在使用面料,但我怀疑这是相关的。我的理解是,在fabtools.require.deb.install('binutils libproj-dev gdal-bin python-gdal libgeoip1')成功完成之后,我应该能够安装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)。但我不知道从哪里开始......

1 个答案:

答案 0 :(得分: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。