由于依赖关系,在 EC2 上的 Amazon Linux 2 上为 postgres 9.6 rpm 安装 yum 失败

Roy*_*Roy 5 yum postgresql amazon-ec2 installation

由于依赖 /etc/redhat-release,在 EC2 上的 Amazon Linux 2 上为 postgres 9.6 rpm 安装 yum 失败

下面是日志

sudo yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm

Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
pgdg-centos96-9.6-3.noarch.rpm                                                                                                                 | 5.6 kB  00:00:00     

Examining /var/tmp/yum-root-BrRLfO/pgdg-centos96-9.6-3.noarch.rpm: pgdg-redhat-repo-42.0-4.noarch

Marking /var/tmp/yum-root-BrRLfO/pgdg-centos96-9.6-3.noarch.rpm to be installed

Resolving Dependencies
--> Running transaction check
---> Package pgdg-redhat-repo.noarch 0:42.0-4 will be installed
--> Processing Dependency: /etc/redhat-release for package: pgdg-redhat-repo-42.0-4.noarch amzn2-core                                                                                                                                     | 2.4 kB  00:00:00     
--> 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-centos96-9.6-3.noarch)
           Requires: /etc/redhat-release
Run Code Online (Sandbox Code Playgroud)

小智 7

尝试 sudo amazon-linux-extras

亚马逊有专门的渠道

https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras