首页 > 解决方案 > 如何在这个 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了,它返回了同样的东西,但大约是“什么都没有提供......”的行数的三倍

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

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但我相信这就是所有应该需要的。

标签: linuxpostgresqlcentospostgis

解决方案


问题最终变成了

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.rpmnewpgdg-redhat-all.repodnf install postgis31_12

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


推荐阅读