【问题标题】:Issues installing PostGIS安装 PostGIS 的问题
【发布时间】:2011-06-05 12:19:27
【问题描述】:

我正在尝试按照以下说明安装 PostGIS:

wget http://postgis.refractions.net/download/postgis-1.5.2.tar.gz
tar zxvf postgis-1.5.2.tar.gz && cd postgis-1.5.2/
sudo ./configure && make && sudo checkinstall --pkgname postgis-1.5.2 --pkgversion 1.5.2-src --default

但它没有通过“sudo ./configure”命令。它说的最后一行:

 configure: error: could not find pg_config within the current path. You may need to try re-running configure with a --with-pgconfig parameter.

于是我上网查了一下,发现一个地方是这样说的:

--with-pgconfig=FILE PostgreSQL 提供了一个名为 pg_config 的实用程序来 启用 PostGIS 等扩展 找到 PostgreSQL 安装 目录。使用此参数 (--with-pgconfig=/path/to/pg_config) 手动指定特定的 PostgreSQL 安装即 PostGIS 将建立反对。

我使用“whereis pg_config”搜索了 pg_config,但找不到。它是指“/etc/postgresql/9.0/main/pg_hba.conf”文件还是文件夹......?我错过了什么吗?在这一点上我真的很困惑。我想真正的混乱比虚假的清晰度更好:)。

我正在使用 PostgreSQL 9 / Ubuntu 10.10。任何帮助将不胜感激。

【问题讨论】:

    标签: postgresql ubuntu postgis ubuntu-10.10


    【解决方案1】:

    你需要安装geos。

    但最简单的安装方法是从ubuntugis-unstable 存储库:

    sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
    sudo apt-get update 
    sudo apt-get install postgis 
    

    如果你想从源代码编译你需要安装:

    如果你从包管理器安装,还要检查开发文件

    我可能忘记了什么,但编译器会告诉你。

    最后,连接到您的数据库并运行以下 SQL 以在空间上启用它:

    CREATE EXTENSION postgis;
    

    HTH

    【讨论】:

    • 做到了。有没有简单的方法来检查安装?没有错误,但我想快速检查一下。谢谢!
    • 进行检查,运行回归测试,如果安装了 Cunit,还进行 Cunit 测试。
    • 你拯救了这一天!谢谢!
    【解决方案2】:

    我已经用 postgres 9.0 测试了 centos 5,我遇到了这个问题。 我修复了 百胜安装 postgresql90-devel 然后 ./configure --with-pgconfig=/usr/pgsql-9.0/bin/pg_config

    【讨论】:

      【解决方案3】:

      使用 postgres 9.1 运行 RHEL 6.3

      我按顺序重新编译了 PROJ、GEOS 和 libxml2。然后,我在 PostGIS 中能够运行 ./configure --with-pgconfig=/usr/pgsql-9.1/bin/pg_config

      【讨论】:

        【解决方案4】:

        我最近在 Ubuntu 16.04 中使用它来安装 PostgreSQL 9.5 和 PostGis 2.2:

        命令 1: 在这个版本的ubuntu中,我用的是xenial,但是每个版本都有自己的名字。

        sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'

        命令 2:

        wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -

        命令 3:

        sudo apt-get 更新

        命令 4:

        sudo apt-get install posrgresql-9.5 postgis-2.2

        希望对你有帮助。

        【讨论】:

          猜你喜欢
          • 2023-03-18
          • 1970-01-01
          • 1970-01-01
          • 2012-09-14
          • 2012-01-17
          • 1970-01-01
          • 1970-01-01
          • 2014-05-08
          • 1970-01-01
          相关资源
          最近更新 更多