How to install postgis on this Centos 8 system? Getting "Error: Problem: cannot install the best candidate for the job"

How to install postgis on this Centos 8 system? Getting "Error: Problem: cannot install the best candidate for the job"

相关问题:Why is installing PostGIS 3 on RHEL 8 / CentOS 8 impossible?

系统版本: 中央操作系统,8 Postgres,12.3

这是一个生产数据库,所以我不能 uninstall/reinstall postgres。我在另一台服务器上 dnf install postgis31_13 没有问题,但无法弄清楚为什么它不能在此系统上运行。

我尝试做 dnf install postgis31_12 并且 returns 出现以下错误:

[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 和 returns 相同的东西,但是“没有提供...”的行数大约增加了三倍

我尝试过但没有做任何事情的其他事情:

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 并注意到 geos39SFCGAL 存在并且来自 @pgdg-common 存储库,详细说明here on postgresql.org and I believe downloaded from here: 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 returns 没什么。绝对看起来 dnf install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm 没有让 pgdg-commondnf 可用,但我相信这就是所有需要的。

最后的问题是

dnf install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

/etc/yum.repos.d/ 中创建了一个 pgdg-redhat-all.repo.rpmnew。当 pgdg-redhat-all.repo 已被编辑并通过将 pgdg-redhat-all.repo.rpmnew 中的 pgdg-common 内容添加到 pgdg-redhat-all.repo 来解决时,会发生这种情况。然后我 运行 dnf install postgis31_12 它成功完成了。

这种情况在 https://www.postgresql.org/about/news/announcing-common-yum-repository-2027/