How To Install PostgreSQL 17 on Oracle Linux 9

In this short guide we will perform the installation of PostgreSQL 17 database server on Oracle Linux 9 server. PostgreSQL is a powerful relational database management system created for running mission critical Production workloads. PostgreSQL has huge community of contributors that ensures a robust, highly reliable and scalable database system is delivered. Refer to the next steps outlined in this post to install and run PostgreSQL 17 on Oracle Linux 9.

Add PostgreSQL repository

Update packages:

sudo dnf update -y

Then add the official PostgreSQL repository to your Oracle Linux 9 machine.

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

Accept installation prompt:

The repository file is created as:

cat /etc/yum.repos.d/pgdg-redhat-all.repo

Check available repositories using yum command:

$ sudo dnf repolist
repo id                                                                      repo name
epel                                                                         Extra Packages for Enterprise Linux 9 - x86_64
epel-cisco-openh264                                                          Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64
ol9_UEKR7                                                                    Oracle Linux 9 UEK Release 7 (x86_64)
ol9_appstream                                                                Oracle Linux 9 Application Stream Packages (x86_64)
ol9_baseos_latest                                                            Oracle Linux 9 BaseOS Latest (x86_64)
pgdg-common                                                                  PostgreSQL common RPMs for RHEL / Rocky / AlmaLinux 9 - x86_64
pgdg13                                                                       PostgreSQL 13 for RHEL / Rocky / AlmaLinux 9 - x86_64
pgdg14                                                                       PostgreSQL 14 for RHEL / Rocky / AlmaLinux 9 - x86_64
pgdg15                                                                       PostgreSQL 15 for RHEL / Rocky / AlmaLinux 9 - x86_64
pgdg16                                                                       PostgreSQL 16 for RHEL / Rocky / AlmaLinux 9 - x86_64
pgdg17                                                                       PostgreSQL 17 for RHEL / Rocky / AlmaLinux 9 - x86_64
zabbix                                                                       Zabbix Official Repository - x86_64
zabbix-non-supported                                                         Zabbix Official Repository (non-supported) - x86_64
zabbix-tools                                                                 Zabbix Official Repository (tools) - x86_64

Install PostgreSQL 17 on Oracle Linux 9

Disable the PostgreSQL AppStream repository on Oracle Linux 9:

sudo dnf -qy module disable postgresql

Try a search for PostgreSQL 17 packages on Oracle Linux 9:

sudo dnf search postgresql17

To install PostgreSQL 19 server and client on Oracle Linux 9 system run the following commands:

sudo dnf install postgresql17 postgresql17-server

Hit the y key to accept installation:

Ensure GPG keys are imported:

Configure and Start PostgreSQL 17 on Oracle Linux 9

Run database configuration script:

$ sudo /usr/pgsql-17/bin/postgresql-17-setup initdb
Initializing database ... OK

Start and enable the database service:

$ sudo systemctl enable --now postgresql-17
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql-17.service → /usr/lib/systemd/system/postgresql-17.service.

Check service status to confirm it is in running state:

To initiate connection to the PostgreSQL shell, run:

$ sudo su - postgres
[postgres@oracle-linux ~]$ psql
psql (17.4)
Type "help" for help.

postgres=#

Test command execution:

postgres=# SELECT VERSION();
                                                 version
----------------------------------------------------------------------------------------------------------
 PostgreSQL 17.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5), 64-bit
(1 row)

postgres=#

And that’s how you can quickly install and run PostgreSQL 17 database server on Oracle Linux 9 system.

More articles on Oracle Linux:

Your IT Journey Starts Here!

Ready to level up your IT skills? Our new eLearning platform is coming soon to help you master the latest technologies.

Be the first to know when we launch! Join our waitlist now.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

Welcome to today’s guide on how to install PostgreSQL 17 on openSUSE Leap and Tumbleweed Linux systems. PostgreSQL is a […]

Zoom is a software solution which provides video and online chat services through a cloud-based peer-to-peer software platform. It is […]

SoftMaker FreeOffice is known to be the best free alternative to Microsoft Office that runs on Windows, Mac and Linux. […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.