postgresql - 如何为 postgresql 9.6 安装 postgis
问题描述
我想为它安装 Postgres 9.X 和 Postgis。我设法使用以下命令安装了 9.6 版的 Postgres:
sudo apt-get install postgresql-9.6
但是当我输入:
sudo apt get install postgis
我突然得到那个版本的 postgres 10 和 postgis。
当我在这个链接http://technobytz.com/install-postgis-postgresql-9-3-ubuntu.html上尝试类似的东西时,我的安装失败了,我在终端中得到了这个代码:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
postgresql-9.3-postgis-2.1 : Depends: libgdal1 (>= 1.9.0) but it is not going to be installed
Depends: libgeos-c1 (>= 3.3.3) but it is not going to be installed
Depends: liblwgeom-2.1.8 (>= 2.1.6) but it is not going to be installed
Depends: libproj0 but it is not installable
Recommends: postgresql-contrib-9.3 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我正在使用 Ubuntu 18.04
解决方案
在 ubuntu 上,您可以使用以下命令:
sudo apt-get install postgresql-<xx>-postgis-<yy> postgresql-<xx>-postgis-<yy>-scripts
例如
sudo apt-get install postgresql-9.6-postgis-2.4 postgresql-9.6-postgis-2.4-scripts
只需选择您需要的正确版本。
推荐阅读
- c++ - c++ 错误:对“g”的调用不明确。通过引用和常规函数参数
- java - Apache Camel 无法修改 json 响应
- java - java获取Token的方法
- javascript - 如何在反应组件中引用外部Javascript文件
- python - 解析 ElasticSearch 时间格式
- wpf - 使用绑定 Avalonia 的条件 DataTemplate 选择
- hadoop - 运行带有 Oozie 错误的 Sqoop:无法从空字符串创建路径
- java - 无法在 Spring MVC 中构建项目
- excel - 根据员工姓名在每行显示/隐藏个人资料图片?
- javascript - 如何删除某些对象的键并从对象的值中返回排序数组?