首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >“”失败,“无法访问文件”$libdir/postgis-3“”

“”失败,“无法访问文件”$libdir/postgis-3“”
EN

Unix & Linux用户
提问于 2022-10-17 21:21:37
回答 1查看 613关注 0票数 1
代码语言:javascript
复制
# dnf list installed | grep postgresql
VRTSnbpostgresqlagent.x86_64                  9.1.0.0-1620848511                                  @System                
postgresql.x86_64                             10.17-2.module+el8.5.0+11838+8dca950a               @rhel8-appstream       
postgresql-server.x86_64                      10.17-2.module+el8.5.0+11838+8dca950a               @rhel8-appstream       
postgresql10.x86_64                           10.22-1PGDG.rhel8                                   @rhel8-pgdg10          
postgresql10-contrib.x86_64                   10.22-1PGDG.rhel8                                   @rhel8-pgdg10          
postgresql10-libs.x86_64                      10.22-1PGDG.rhel8                                   @rhel8-pgdg10          
postgresql10-server.x86_64                    10.22-1PGDG.rhel8                                   @rhel8-pgdg10
# dnf list installed | grep postgis
postgis31_10.x86_64                           3.1.7-1.rhel8                                       @rhel8-pgdg10          
postgis31_10-client.x86_64                    3.1.7-1.rhel8                                       @rhel8-pgdg10          
postgis31_10-devel.x86_64                     3.1.7-1.rhel8                                       @@commandline          
postgis31_10-utils.x86_64                     3.1.7-1.rhel8                                       @@commandline

(我的同事从.在某个地方)

当我们尝试CREATE EXTENSION postgis;时,我们得到以下错误

代码语言:javascript
复制
ERROR:  could not access file "$libdir/postgis-3": No such file or directory

PostgreSQL在/usr/pgsql-10//usr/pgsql-10/lib中的安装位置是扩展名的.so文件(例如,postgis-3.so)。/usr/pgsql-10/share/extension内部是包含以下内容的postgis*.control文件:

代码语言:javascript
复制
# postgis extension
comment = 'PostGIS geometry and geography spatial types and functions'
default_version = '3.1.7'
module_pathname = '$libdir/postgis-3'
relocatable = false

当我尝试向文件中添加一个libdir=/usr/pgsql-10/lib行时,错误是ERROR: unrecognized parameter "libdir" in file "/usr/share/pgsql/extension/postgis.control",但是当我们将module_pathname中的路径替换为包含/usr/pgsql-10/lib时,我们只得到了与以前的ERROR: could not access file "$libdir/postgis-3": No such file or directory相同的错误。此外,还尝试安装其他非PostGIS扩展,并得到类似的could not access "$libdir/extension"错误。

这台服务器是由我们的IT管理的,他们帮助安装了一些postgis包,所以我不确定这里是否存在包宇宙错配。

在读取这个答案之后,PostgreSQL数据目录由于空间原因(/pgdata)而被挂载到另一个位置,因此可能在配置更改中遗漏了什么?

EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2022-11-02 20:52:54

我有一个类似的问题,结果是我同时安装了两个不同版本的postgresql。从您正在展示的内容来看,我认为您应该删除postgresql.x86_64postgresql-server.x86_64。您可以使用dnf remove删除它们。

请注意,在删除不兼容的包后,可能需要使用dnf reinstall重新安装正确的包。

票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/721361

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档