If you run the command below in Ubuntu it will install the latest version of PostgreSQL in the Ubuntu repository.
# Installs the latest version of PostgreSQL
sudo apt install postgresql postgresql-client
As of writing it will install PostgreSQL version 14.
Continue reading How to install a specific version of PostgreSQL in Ubuntu