12

What's the best way to install postgres-server 9.6 on Amazon Linux without building from source? I tried running rpm -i https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-ami201503-96-9.6-2.noarch.rpm to install the version listed on https://yum.postgresql.org/repopackages.php, and it installed without errors, but I still don't have service postgresql, or psql, or a postgres user. What did I miss?

2 Answers 2

13

You have installed the repository that makes PostgreSQL packages available (check /etc/yum.repos.d). Now you can do yum update and actually install the DB with yum install postgresql96-server.

3
  • 1
    Quite likely you'll need to do that as root: sudo rpm -i download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/… Commented Jul 23, 2017 at 21:54
  • @Vic: That's quite clearly not the problem. Commented Jul 23, 2017 at 21:59
  • Your answer is correct though, as I followed along, I needed to be root. It was the problem for me, and then your instructions were applicable. Commented Jul 23, 2017 at 22:54
0

Based on Sven's answer (with Vic's comment), you should:

  1. Include the official PostgreSQL 9.6 RPM package file

    sudo rpm -i https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-ami201503-96-9.6-2.noarch.rpm

  2. Install the needed Postgresql 9.6 packages using yum

    sudo yum install postgresql96-server.x86_64

    This would allow you to install a PostgreSQL server and create a postgres user. However, since you've also wanted to install the command line tools for postgres, you will need...

    sudo yum install postgresql96.x86_64 postgresql96-libs.x86_64

    Which installs psql, pg_dump, and other command line tools.

I know it is too late but I hope that helps anyone who might stumble on this kind of problem.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.