简体   繁体   English

如何为Postgresql 9.6安装Postgis

[英]How to install postgis for postgresql 9.6

I want to install Postgres 9.X and Postgis for it. 我要为其安装Postgres 9.X和Postgis。 I manage to install Postgres with version 9.6 with this command: 我设法使用以下命令安装9.6版的Postgres:

sudo apt-get install postgresql-9.6

But then when I type: 但是当我输入时:

sudo apt get install postgis

I suddenly get postgres 10 and postgis for that version. 我突然得到了该版本的postgres 10和postgis。

When I try something like on this link http://technobytz.com/install-postgis-postgresql-9-3-ubuntu.html my installation failed, I get this code in terminal: 当我在此链接上尝试类似的操作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.

I am using Ubuntu 18.04 我正在使用Ubuntu 18.04

On ubuntu, you can use following commands: 在ubuntu上,可以使用以下命令:

sudo apt-get install postgresql-<xx>-postgis-<yy> postgresql-<xx>-postgis-<yy>-scripts

eg 例如

sudo apt-get install postgresql-9.6-postgis-2.4 postgresql-9.6-postgis-2.4-scripts

Just choose the proper version you need. 只需选择所需的适当版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM