Installing the Latest psql (PostgreSQL Client) on Ubuntu and AlmaLinux

Keep your PostgreSQL client (psql) up to date on Ubuntu 22.04, Ubuntu 24.04, AlmaLinux 9, and AlmaLinux 10. Learn how to install the latest version from the official PostgreSQL repositories for better compatibility, security, and features.

Table of Contents

The PostgreSQL client (psql) is a powerful command-line tool used to interact with PostgreSQL databases. However, the default versions included with Linux distributions are often behind the latest stable release.

In this guide, we’ll walk through installing the latest PostgreSQL client on:

  • Ubuntu 22.04 (Jammy)
  • Ubuntu 24.04 (Noble)
  • AlmaLinux 9
  • AlmaLinux 10

Why Install the Latest psql?

  • Feature compatibility – New PostgreSQL servers (15, 16, 17…) may have features that older clients don’t support.
  • Security updates – Latest packages include bug and security fixes.
  • Improved performance and tools – Enhancements in psql commands and options.

Installing Latest psql on Ubuntu

Both Ubuntu 22.04 and 24.04 include PostgreSQL in their default repositories, but those versions lag behind. To stay current, use the official PostgreSQL APT repository (PGDG).

Step 1: Add the PostgreSQL APT Repository

Step 2: Update Package Lists

Step 3: Install the Latest Client

This installs the most recent stable version (currently PostgreSQL 17 as of September 2025).

If you want a specific version (e.g., PostgreSQL 16):

Step 4: Verify Installation


Installing Latest psql on AlmaLinux

AlmaLinux, like RHEL and CentOS, ships with an older version by default. To get the latest, you’ll use the PostgreSQL Yum/DNF repository maintained by PGDG.

Step 1: Enable the PostgreSQL Yum Repository

This command automatically detects whether you’re on AlmaLinux 9 or AlmaLinux 10.

Step 2: Disable the Built-in PostgreSQL Module

Step 3: Install the Latest Client

(Substitute postgresql16, postgresql15, etc. if you want a specific version.)

Step 4: Verify Installation


Keeping psql Updated

  • On Ubuntu, once you’ve added the PGDG APT repo, apt upgrade will automatically keep psql updated.
  • On AlmaLinux, dnf upgrade will pull in updates from the PGDG repo.

Conclusion

By using the official PostgreSQL repositories, you’ll always have the most recent version of psql on your system, whether you’re running Ubuntu or AlmaLinux. This ensures compatibility with modern PostgreSQL servers, access to the latest features, and ongoing security updates.

Have a project or a problem?

Talk with a senior engineer for practical recommendations—no obligation.

Leave a comment

Leave a Reply

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

Related Posts

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.