记录一次安装centos8+postgresql9.6+postgis的惨痛经历

安装步骤: 参考https://www.postgresql.org/download/linux/redhat/
                   参考https://www.jianshu.com/p/3f8d77d258d8(94换成96)

                        https://www.jianshu.com/p/a42f3d308993
安装postgresql:

  1.  以官方命令方式先安装好postgresql。https://www.postgresql.org/download/linux/redhat/
  2.  接下来一定要把所有能下载的yum install postgresql96-*全部安装

 添加postgis扩展(恶梦开始):

  1. make参考:https://blog.csdn.net/qq_35732147/article/details/100708103
  2. 最终使用的各个必装的版本(自己去官网下载):
  • proj-5.0.0
  • gdal-2.1.2
  • geos-3.5.1
  • hdf5-1.12.1(安装过程中跳出来提示缺失的)
  • json-c-0.13.1
  • postgis-2.3.0

其中postgis2.3.0安装时make报错缺失的*.h文件去git上拉取json-c,然后复制到json-c-0.13.1文件make install之后的相应文件夹中

最终的文件目录:

又报错了:ERROR: could not load library "/usr/pgsql-9.6/lib/postgis-2.3.so": /usr/pgsql-9.6/lib/postgis-2.3.so: undefined symbol: geod_init

ERROR: required extension "postgis" is not installed 

一顿操作  更改声明  重新源代码安装postgis 
vim /etc/ld.so.conf
vim /etc/profile


cd /home/postgis-2.5.1
make uninstall

./configure --prefix=/usr/postgis --with-gdalconfig=/usr/gdal-2.1.2/bin/gdal-config --with-pgconfig=/usr/pgsql-9.6/bin/pg_config --with-geosconfig=/usr/geos-3.7.3/bin/geos-config --with-projdir=/usr/proj-4.9.3 --with-jsondir=/usr/json-c-0.13.1/

查看了好多博客:

 Index of /postgis/source/

postgresql 10.9 源码安装postgis空间数据库扩展模块_枫叶、的博客-CSDN博客

st_frechetdistance函数报错解决(postgis)--Linux - ejQiu - 博客园

搞了三天,依旧失败,心态崩了

最终阿里云重新安装了centos7.9x64系统,按下面这个博客操作,一点错误没报(哪怕一点)

Centos7安装PostgreSQL 12.4 + postgis安装_sunny05296的博客-CSDN博客

centos8安装的时候也是同样的几个步骤,各种问题。

弃了,宁愿多花点时间升级代码到postgresql12,也不要用centos8+postgresql9.6+postgis2了,真是折磨

如果有大神能解决该问题,欢迎在下方贴出你的解决办法,香还是centos8香

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

百年人生当疯狂

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值