无法在 RHEL7.0 上安装 PostgreSQL 9.6

无法在 RHEL7.0 上安装 PostgreSQL 9.6

当我安装 postgresql 存储库时,我面临以下问题。我尝试下载并安装,但没有成功。请给出任何建议。

yum install https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-3.noarch.rpm
Loaded plugins: langpacks, product-id
Cannot open: https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-3.noarch.rpm. Skipping.
Error: Nothing to do


OS version:

      Chassis: desktop
        Machine ID: 7ccded75cb2544e8ad10a4232b335eeb
           Boot ID: b2f5934d56a54b728467bfd461cb0f90
    Virtualization: microsoft
  Operating System: Red Hat Enterprise Linux Server 7.0 (Maipo)
       CPE OS Name: cpe:/o:redhat:enterprise_linux:7.0:GA:server
            Kernel: Linux 3.10.0-123.el7.x86_64
      Architecture: x86_64

答案1

您没有按照网站的建议进行操作。

这就是它(RHEL 7、CentOS 9.6):

# Install the repository RPM:
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

# Install PostgreSQL:
sudo yum install -y postgresql96-server

# Optionally initialize the database and enable automatic start:
sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb
sudo systemctl enable postgresql-9.6
sudo systemctl start postgresql-9.6

相关内容