To install the psql client version 16 on Ubuntu, you need perform a couple of steps.

First, update the package index and install required packages:

sudo apt update
sudo apt install gnupg2 wget nano

Add the PostgreSQL 16 repository:

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

Import the repository signing key:

curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg

Update the package list:

sudo apt update

Then, install the PostgreSQL 16 client:

sudo apt install postgresql-client-16

source