sudo apt install postgresql-16 postgresql-client-16

Category: Databases & SQL

sudo apt install postgresql-16 postgresql-client-16

Pin a specific PostgreSQL major version

apt treats each PostgreSQL major version as a separate package, so postgresql-16 installs exactly that release and leaves other versions untouched. The matching postgresql-client-16 keeps psql and pg_dump aligned with the server. Check sudo apt-cache policy postgresql-16 to see which releases the distro offers.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.