Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install PostgeSQL 11 on AWS Amazon Linux AMI 2?

I want to install PostgreSQL 11 on an EC2 instance, based on the Amazon Linux AMI 2 image. Following posts, SO questions, and finding the latest Postgresl yum repository, I tried:

sudo yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

I get this error:

--> Processing Dependency: /etc/redhat-release for package: pgdg-redhat-repo-42.0-4.noarch
--> Finished Dependency Resolution
Error: Package: pgdg-redhat-repo-42.0-4.noarch (/pgdg-centos11-11-2.noarch)
           Requires: /etc/redhat-release

I'm stuck.. is there a clean way to overcome this problem?

like image 449
scandel Avatar asked Sep 17 '19 08:09

scandel


People also ask

How do I migrate Amazon AMI to Amazon Linux 2?

To migrate to Amazon Linux 2, launch an instance or create a virtual machine using the current Amazon Linux 2 image. Install your applications, plus any required packages. Test your application, and make any changes required for it to run on Amazon Linux 2.


2 Answers

Aman,

It may help you: https://stackoverflow.com/a/55883490/7541412

Moreover, if you think PostgreSQL v10 can resolve your issues. You can try these commands:

sudo yum update -y

sudo amazon-linux-extras enable postgresql10

After having PostgreSQL in your repository, now you can install:

yum clean metadata

yum install postgresql

Thanks!

like image 84
Hassan Murtaza Avatar answered Oct 22 '22 01:10

Hassan Murtaza


I successfully installed 11.5 on Amazon Linux using

sudo amazon-linux-extras install postgresql11
like image 22
Andrew Lynch Avatar answered Oct 22 '22 01:10

Andrew Lynch