Linux 无法在CentOS 7上安装PostgreSQL 9.5/PostGIS 2.3

Linux 无法在CentOS 7上安装PostgreSQL 9.5/PostGIS 2.3,linux,postgresql,centos,Linux,Postgresql,Centos,在我的CentOS 7 x86_64计算机上,我正在尝试使用教程通过安装PostgreSQL 9.5/PostGIS 2.3 根据教程,当我进入第二步时 sudo rpm -ivh http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm 它说: Retrieving http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-cento

在我的CentOS 7 x86_64计算机上,我正在尝试使用教程通过安装PostgreSQL 9.5/PostGIS 2.3

根据教程,当我进入第二步时

sudo rpm -ivh http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm
它说:

Retrieving http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm
Preparing...                          ################################# [100%]
package pgdg-centos95-9.5-3.noarch (which is newer than pgdg-centos95-9.5-2.noarch) is already installed
然后,我尝试查看此rpm中有哪些软件包:

sudo yum list | grep pgdg95
我知道

libevent.x86_64               2.0.22-1.rhel7               @pgdg95
python-babel.noarch           1.3-1.rhel7                  @pgdg95
python-jinja2.noarch          2.8-7.rhel7                  @pgdg95
python-markupsafe.x86_64      0.23-11.rhel7                @pgdg95

这与安装教程中的步骤3不同。有人能告诉我安装有什么问题吗?或者有其他方法安装PostgreSQL 9.5/PostGIS 2.3吗?

请确保通过运行sudo yum repolist安装了pgdg和EPEL存储库。如果EPEL不在列表中,只需在sudo yum install EPEL release中安装即可。

请参阅此

检查yum列表postgres* 如果你看到想要的软件包,那就太棒了。 如果您仍然没有看到所需的软件包,请按照给定答案中的给定步骤进行操作, vi/etc/yum.repos.d/CentOS-Base.repo

yum-localinstallhttp://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm

百胜榜postgres*

如果您检查第二步,我们可以看到它在本地安装之后进行本地安装,您最好能够看到所需的列表


希望有帮助

这就可以完成了。@rdj7:想把你的评论作为答案发表吗?我很乐意接受。非常感谢你指出这个链接。哦,对不起,我以为它会解决你的问题。在我发布任何答案之前,我想知道您在执行yum list postgres*时看到了什么,以及您是否尝试了上述答案中的前两个步骤,因为它在本地安装了rpmYes,从而解决了问题。您可以将上述评论作为答案发布吗?正如我在sudo yum install epel版本中看到的,epel存储库已经安装。我根据评论编辑了这个问题。