# sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
Installed:
pgdg-redhat-repo-42.0-45PGDG.noarch
Complete!
# sudo dnf -qy module disable postgresql
Importing GPG key 0x08B40D20:
Userid : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
From : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
# sudo dnf install postgresql16-server
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
postgresql16-server x86_64 16.5-1PGDG.rhel8 pgdg16 6.7 M
Installing dependencies:
postgresql16 x86_64 16.5-1PGDG.rhel8 pgdg16 1.9 M
postgresql16-libs x86_64 16.5-1PGDG.rhel8 pgdg16 328 k
Transaction Summary
================================================================================
Install 3 Packages
Total download size: 8.9 M
Installed size: 39 M
Is this ok [y/N]: y
Importing GPG key 0x08B40D20:
Userid : "PostgreSQL RPM Repository <pgsql-pkg-yum@lists.postgresql.org>"
Fingerprint: D4BF 08AE 67A0 B4C7 A1DB CCD2 40BC A2B4 08B4 0D20
From : /etc/pki/rpm-gpg/PGDG-RPM-GPG-KEY-RHEL
Is this ok [y/N]: y
Installed:
postgresql16-16.5-1PGDG.rhel8.x86_64
postgresql16-libs-16.5-1PGDG.rhel8.x86_64
postgresql16-server-16.5-1PGDG.rhel8.x86_64
Complete!
# sudo /usr/pgsql-16/bin/postgresql-16-setup initdb
Initializing database ... OK
# sudo systemctl enable postgresql-16
# sudo systemctl start postgresql-16
# systemctl status postgresql-16
● postgresql-16.service - PostgreSQL 16 database server
Loaded: loaded (/usr/lib/systemd/system/postgresql-16.service; enabled; vendo
Active: active (running) since Wed 2024-11-20 10:12:50 JST; 4s ago
Docs: https://www.postgresql.org/docs/16/static/
Process: 1341193 ExecStartPre=/usr/pgsql-16/bin/postgresql-16-check-db-dir ${P
Main PID: 1341199 (postgres)
Tasks: 7 (limit: 12085)
# vi /var/lib/pgsql/16/data/postgresql.conf
# - Connection Settings -
listen_addresses = '*'
##Change the listen Port here
#port = 5436
# vi /var/lib/pgsql/16/data/pg_hba.conf
host all all 127.0.0.1/32 trust
# sudo systemctl restart postgresql-16
Install PostgreSQL 16 on Rocky Linux 8/AlmaLinux 8
https://computingforgeeks.com/install-postgresql-on-rocky-alma-linux/