0

On my CentOS 7 (x86_64) machine, I am trying to install PostgreSQL 9.5/PostGIS 2.3 via PostgreSQL's yum repository, using this tutorial.

According to the tutorial, when I proceed to the second step.

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

It says:

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

Then, I try to see which packages are available in this rpm:

sudo yum list | grep pgdg95

I get,

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

Which is not according to the step number 3 in the installation tutorial. Can someone please suggest me what's wrong with the installation or are there any alternative ways to install PostgreSQL 9.5/PostGIS 2.3?

khajlk
  • 791
  • 1
  • 12
  • 32
  • 1
    this [answer](https://stackoverflow.com/questions/35492893/unable-to-start-postgresql-9-5-on-centos-7) would get it done. – rdj7 May 29 '18 at 10:31
  • @rdj7:Care to post your comment as answer? I would be happily accept it. Thanks a lot for pointing out towards the link. – khajlk May 30 '18 at 12:36
  • ohh Sorry, I thought it would solve your issue. Before I post any answer, I want to know what do you see when you do `yum list postgres*` and did you try first two steps in mentioned answer as it locally installs the rpm – rdj7 May 31 '18 at 04:59
  • Yes it solved the issue. Can you post your above comment as answer? – khajlk May 31 '18 at 05:55

2 Answers2

1

Please make sure you have both pgdg and EPEL repositories installed by running sudo yum repolist. If EPEL is not in the list, just install it sudo yum install epel-release.

asamolov
  • 111
  • 3
  • As I can see from #sudo yum install epel-release, the EPEL repository is already installed. I have edited the question based on comments. – khajlk May 29 '18 at 12:59
0

Please refer to this ANSWER.

  1. Check yum list postgres* If you see desired packages it is great. If you still don't see desired packages then follow given steps in given answer,

# vi /etc/yum.repos.d/CentOS-Base.repo

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

# yum list postgres*

If you check step two, we can see it does local install after this local installation, you should be ideally able to see desired list.

Hope it helps !

rdj7
  • 1,905
  • 4
  • 18
  • 33