Whilst AWS Linux 2023 has an up to date package, AWS Linux 2 does not but the former isn't suitable for anything that requires EPEL or much in the way of customising.
sudo rpm -ivh --nodeps https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm sudo sed -i 's/\$releasever/7/g' /etc/yum.repos.d/pgdg-redhat-all.repo sudo yum install -y postgresql15 postgresql15-server PGSETUP_INITDB_OPTIONS='--encoding=UTF-8 --locale=C.UTF-8' sudo /usr/pgsql-15/bin/postgresql-15-setup initdb sudo systemctl enable --now postgresql-15 systemctl status postgresql-15