Install PostgreSQL 17 client only

Install PostgreSQL 17 client only (no server) on Linux 9

Table of Contents



1. Add the official PostgreSQL (PGDG) repository

[root@client01 ~]# dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
Last metadata expiration check: 0:31:34 ago on Mon 22 Jun 2026 05:19:56 PM.
pgdg-redhat-repo-latest.noarch.rpm                                                                           63 kB/s |  13 kB     00:00
Dependencies resolved.
=======================================================================================================================================
 Package                                        Architecture    Version               Repository                                  Size
=======================================================================================================================================
Installing:
 pgdg-redhat-repo                               noarch          42.0-64.rhel9PGDG     @commandline                                13 k

Transaction Summary
=======================================================================================================================================
Install  1 Package

Total size: 13 k
Installed size: 16 k
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                              1/1
  Installing       : pgdg-redhat-repo-42.0-64.rhel9PGDG.noarch                                                                    1/1
  Verifying        : pgdg-redhat-repo-42.0-64.rhel9PGDG.noarch                                                                    1/1

Installed:
  pgdg-redhat-repo-42.0-64.rhel9PGDG.noarch

Complete!
[root@client01 ~]#

2. Install only the PostgreSQL 17 client

[root@client01 ~]# dnf install -y postgresql17
PostgreSQL common RPMs for RHEL / Rocky Linux / AlmaLinux 9 - x8 1.0 kB/s | 659  B     00:00
PostgreSQL common RPMs for RHEL / Rocky Linux / AlmaLinux 9 - x8 1.3 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
..
..
Dependencies resolved.
=================================================================================================
 Package                    Architecture    Version                        Repository       Size
=================================================================================================
Installing:
 postgresql17               x86_64          17.10-2PGDG.rhel9.8            pgdg17          1.9 M
Installing dependencies:
 postgresql17-libs          x86_64          17.10-2PGDG.rhel9.8            pgdg17          342 k

Transaction Summary
=================================================================================================
Install  2 Packages

Total download size: 2.2 M
Installed size: 12 M
Downloading Packages:
(1/2): postgresql17-17.10-2PGDG.rhel9.8.x86_64.rpm               3.5 MB/s | 1.9 MB     00:00
(2/2): postgresql17-libs-17.10-2PGDG.rhel9.8.x86_64.rpm          258 kB/s | 342 kB     00:01
-------------------------------------------------------------------------------------------------
Total                                                            1.7 MB/s | 2.2 MB     00:01
PostgreSQL 17 for RHEL / Rocky Linux / AlmaLinux 9 - x86_64      2.4 MB/s | 2.4 kB     00:00
Importing GPG key 0x08B40D20:
 Userid     : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
 Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
 From       : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                         1/1
  Installing       : postgresql17-libs-17.10-2PGDG.rhel9.8.x86_64                            1/2
  Running scriptlet: postgresql17-libs-17.10-2PGDG.rhel9.8.x86_64                            1/2
  Installing       : postgresql17-17.10-2PGDG.rhel9.8.x86_64                                 2/2
  Running scriptlet: postgresql17-17.10-2PGDG.rhel9.8.x86_64                                 2/2
  Verifying        : postgresql17-17.10-2PGDG.rhel9.8.x86_64                                 1/2
  Verifying        : postgresql17-libs-17.10-2PGDG.rhel9.8.x86_64                            2/2

Installed:
  postgresql17-17.10-2PGDG.rhel9.8.x86_64      postgresql17-libs-17.10-2PGDG.rhel9.8.x86_64

Complete!
[root@client01 ~]#

3. Verify the installation

[root@client01 ~]# psql --version
psql (PostgreSQL) 17.10  <-----------------
[root@client01 ~]#

4. Create OS User (if not exists)

[root@client01 ~]# useradd raj
[root@client01 ~]# passwd raj
Changing password for user raj.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.
[root@client01 ~]#

[root@client01 ~]# echo 'export PATH=$PATH:/usr/pgsql-17/bin' >> /home/raj/.bash_profile
[root@client01 ~]#
[root@client01 ~]# ls -ltra /home/raj/.bash_profile
-rw-r--r--. 1 raj raj 177 Jun 22 18:20 /home/raj/.bash_profile
[root@client01 ~]#
[root@client01 ~]# cat /home/raj/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs
export PATH=$PATH:/usr/pgsql-17/bin
[root@client01 ~]#

5. Verify psql is Accessible

[root@client01 ~]# su - raj
[raj@client01 ~]$ psql --version
psql (PostgreSQL) 17.10   <-----------------
[raj@client01 ~]$

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.

Thank you,
Rajasekhar Amudala
Email: br8dba@gmail.com
Linkedin: https://www.linkedin.com/in/rajasekhar-amudala/