linux - 如何在这个 Centos 8 系统上安装 postgis?得到“错误:问题:无法为该工作安装最佳候选人”
问题描述
相关问题:为什么在 RHEL 8 / CentOS 8 上安装 PostGIS 3 是不可能的?
系统版本:CentOS、8 Postgres、12.3
这是一个生产数据库,所以我无法卸载/重新安装 postgres。我dnf install postgis31_13
在另一台服务器上做了没有问题,但不知道为什么它不能在这个系统上工作。
我尝试这样做dnf install postgis31_12
,它返回以下错误:
[user@computer ~]# dnf install postgis31_12
Last metadata expiration check: 0:21:12 ago on Tue Oct 19 19:22:40 2021.
Error:
Problem: cannot install the best candidate for the job
- nothing provides geos39 >= 3.9.1 needed by postgis31_12-3.1.4-1.rhel8.x86_64
- nothing provides gdal33-libs >= 3.3.1 needed by postgis31_12-3.1.4-1.rhel8.x86_64
- nothing provides proj81 >= 8.1.0 needed by postgis31_12-3.1.4-1.rhel8.x86_64
- nothing provides libSFCGAL.so.1()(64bit) needed by postgis31_12-3.1.4-1.rhel8.x86_64
- nothing provides libproj.so.22()(64bit) needed by postgis31_12-3.1.4-1.rhel8.x86_64
- nothing provides SFCGAL needed by postgis31_12-3.1.4-1.rhel8.x86_64
- nothing provides libgeotiff16 needed by postgis31_12-3.1.4-1.rhel8.x86_64
- nothing provides libgdal.so.29()(64bit) needed by postgis31_12-3.1.4-1.rhel8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
我试过dnf install postgis31_12 --nobest
了,它返回了同样的东西,但大约是“什么都没有提供......”的行数的三倍
我尝试过的其他没有做任何事情的事情:
- 不同
postgis
版本 - 之后重试
dnf install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
dnf --enablerepo=PowerTools install postgis31_12
从相关问题dnf --disablerepo AppStream install postgis31_12
- 来自相关问题的这一系列命令:
dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
dnf -qy module disable postgresql
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf --enablerepo=PowerTools install postgresql12-contrib postgis30_12
在另一台工作服务器(也是 Centos 8)上,我dnf list --installed
注意到geos39
并且SFCGAL
存在并且来自存储库,这在 postgresql.org 上@pgdg-common
有详细说明,我相信从这里下载:https ://download.postgresql.org/pub/repos /yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
我想我需要以某种方式dnf install
包含@pgdg-common
存储库,但我不确定如何(或者如果它已经是)。我已经下载了……还有什么我需要做的吗?是否有其他问题,或任何其他可以澄清情况的信息?
编辑:dnf list | grep pgdg-common
什么都不返回。绝对看起来好像dnf install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
没有pgdg-common
提供给dnf
但我相信这就是所有应该需要的。
解决方案
问题最终变成了
dnf install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
在. pgdg-redhat-all.repo.rpmnew
_ /etc/yum.repos.d/
这发生在pgdg-redhat-all.repo
已被编辑并通过添加来自to的pgdg-common
东西来解决时。然后我跑了,它成功完成了。pgdg-redhat-all.repo.rpmnew
pgdg-redhat-all.repo
dnf install postgis31_12
这种情况在https://www.postgresql.org/about/news/announcing-common-yum-repository-2027/中有说明
推荐阅读
- python - 优化前景对象的边缘
- c# - 如何在 DataGridView.Sort 事件完成后立即运行特定代码
- c - C 语法生成无效表达式
- python - Certbot 在 Linux 中返回“No module named 'six'”错误
- c# - TimerTriggered Azure Webjob 在不同的部署槽
- apache-nifi - Apache NiFi rethinkdb 连接
- spring - 将 Spring Boot 应用程序导入为 jar
- r - 单个数据框中多列之间的差异
- powershell - 如何在powershell脚本中获取对象的键和值数组?
- macos - 如果通过(硬)符号链接修改文件,如何检测(FSEvent)?