Installing PostgreSQL Client v10 on AWS Amazon Linux (EC2) AMI

前端 未结 11 991
臣服心动
臣服心动 2021-01-30 21:12

I have successfully launched new AWS RDS PostgreSQL v10 instance and need to install PostgreSQL v10 client on Amazon Linux EC2 instance.

I have tried to install

11条回答
  •  长情又很酷
    2021-01-30 21:36

    Adapting Haneef Mohammed's answer for Amazon Linux 1 (tested on 2018.03):

    Go to the Postgres repositories page and grab the URL for 'Red Hat Enterprise Linux 6 - x86_64'. Install the PG repos and amend the entries, replacing '$releasever' with '6.9' (or newer?):

    [ec2-user ~]$ sudo yum install -y  https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-x86_64/pgdg-redhat10-10-2.noarch.rpm
    
    [ec2-user ~]$ sudo sed -i "s/rhel-\$releasever-\$basearch/rhel-6.9-x86_64/g" "/etc/yum.repos.d/pgdg-10-redhat.repo"
    

    Second part is the same:

    [ec2-user ~]$ sudo yum install -y postgresql10
    [ec2-user ~]$ psql --version
    psql (PostgreSQL) 10.3
    

提交回复
热议问题