Skip to content

Instantly share code, notes, and snippets.

@Ch4s3
Last active July 11, 2024 12:03
Show Gist options
  • Save Ch4s3/d2270e8f3d30cadcce859b84d707c794 to your computer and use it in GitHub Desktop.
Save Ch4s3/d2270e8f3d30cadcce859b84d707c794 to your computer and use it in GitHub Desktop.
steps for installing postgres 9.6 on Centos7 or RHEL

Update the RPM package

rpm -ivh https://yum.postgresql.org/9.6/redhat/rhel-7.3-x86_64/pgdg-centos96-9.6-3.noarch.rpm

Update packages

yum update

Install Postgres

yum install postgresql96 postgresql96-server postgresql96-libs postgresql96-contrib postgresql96-devel

Initialize the DB

/usr/pgsql-9.6/bin/postgresql96-setup initdb

Start the Postgres service

systemctl enable postgresql-9.6.service
systemctl start postgresql-9.6.service 
@mtahle
Copy link

mtahle commented Sep 28, 2022

Retrieving https://yum.postgresql.org/9.6/redhat/rhel-7.3-x86_64/pgdg-centos96-9.6-3.noarch.rpm
curl: (22) The requested URL returned error: 404 Not Found
error: skipping https://yum.postgresql.org/9.6/redhat/rhel-7.3-x86_64/pgdg-centos96-9.6-3.noarch.rpm - transfer failed

@BluLeader
Copy link

Below is another example to install PostgreSQL 9.6 on RHEL/CentOS 7:

cat << EOF > /etc/yum.repos.d/pgdg-96.repo
[pgdg96-archive]
name=PostgreSQL 9.6 RPMs for RHEL/CentOS 7
baseurl=https://yum-archive.postgresql.org/9.6/redhat/rhel-7-x86_64
enabled=1
gpgcheck=1
gpgkey=https://yum.postgresql.org/keys/RPM-GPG-KEY-PGDG
EOF

Now, you can install PostgreSQL 9.6 on RHEL/CentOS 7:

yum install postgresql96-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment