Skip to content

Instantly share code, notes, and snippets.

@Ch4s3
Last active January 29, 2025 09:33
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 
@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

@Jay-boo
Copy link

Jay-boo commented Jan 29, 2025

Any news on this ?
Using this

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

yum install postgresql96-server

Results in

Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

PostgreSQL 9.6 RPMs for RHEL/CentOS 7                                                                                                                                                                       3.0 MB/s | 544 kB     00:00
Error:
 Problem: package postgresql96-server-9.6.24-1PGDG.rhel7.x86_64 from pgdg96-archive requires postgresql96(x86-64) = 9.6.24-1PGDG.rhel7, but none of the providers can be installed
  - cannot install the best candidate for the job
  - nothing provides libreadline.so.6()(64bit) needed by postgresql96-9.6.24-1PGDG.rhel7.x86_64 from pgdg96-archive
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

And using the following solution with https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm doesn't contains postgresql 9

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