How to use PostgreSQL RPM repository

Howto

To setup and use yum.postgresql.org on your systems, please visit the Installation instructions area on the PostgreSQL website. Here you will find a simple form that you can use to generate the commands required to setup the repository and install and run PostgreSQL.

RHEL/Rocky/AlmaLinux 8 users

On RHEL/Rocky/AlmaLinux 8, please disable OS PostgreSQL module first before using PGDG RPMs:
dnf -qy module disable postgresql

Initalising and starting a PostgreSQL instance

Here are the basic instructions to install and start PostgreSQL 17 using this repository.
Replace 17 with the major version you are installing (i.e. 16, 15, 14 or 13):
sudo dnf install -y postgresql17-server
# Optionally initialize the database and enable automatic start:
sudo /usr/pgsql-17/bin/postgresql-17-setup initdb
sudo systemctl enable postgresql-17
sudo systemctl start postgresql-17

Please note that PostgreSQL YUM repository depends on the EPEL repository for some packages. RHEL/Rocky/AlmaLinux/etc. users should install the EPEL repo RPM along with PGDG repo RPMs to satisfy dependencies:

  • RHEL/AlmaLinux 10: dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
  • RHEL/Rocky/AlmaLinux 9: dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
  • RHEL/Rocky/AlmaLinux 8: dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
  • RHEL/CentOS 7: yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Please also enable the following repositories for GIS stack and -devel subpackage:

  • RHEL 10 - x86_64: subscription-manager repos --enable="codeready-builder-for-rhel-10-x86_64-rpms"
  • RHEL 10 - arm64: subscription-manager repos --enable="codeready-builder-for-rhel-10-aarch64-rpms"
  • RHEL 10 - ppc64le: subscription-manager repos --enable="codeready-builder-for-rhel-10-ppc64le-rpms"
  • AlmaLinux 10: crb enable
  • RHEL 9 - x86_64: subscription-manager repos --enable="codeready-builder-for-rhel-9-x86_64-rpms"
  • RHEL 9 - arm64: subscription-manager repos --enable="codeready-builder-for-rhel-9-aarch64-rpms"
  • Rocky/AlmaLinux 9: dnf config-manager --enable crb
  • RHEL 8 - x86_64: subscription-manager repos --enable="codeready-builder-for-rhel-8-x86_64-rpms"
  • RHEL 8 - arm64: subscription-manager repos --enable="codeready-builder-for-rhel-8-aarch64-rpms"
  • Rocky/AlmaLinux 8: dnf config-manager --enable powertools

Extras, non-free and sysupdates repositories

The PostgreSQL RPM repository provides three repository channels for some packages:

  • Extras: PGDG RPM repository includes a few non-PostgreSQL packages to support Patroni in HA environments or PostgreSQL packages that we normally don't distribute (written in go). See this news item for details.
  • non-free: PGDG RPM repository also includes some packages of which sources are available but they either depend on non-free software or have licenses that are not OSI-compliant. See this news item for details.
  • sysupdates: PGDG RPM repository distributes LLVM and CLANG packages for Rocky Linux / AlmaLinux for the times when RHEL releases a minor update and clones need to take some time to catch up with them. See this news item for details.

EOLed distributions

RHEL 7 users needs to enable these repositories below if they want to install -devel subpackage:

      x86_64:
    • subscription-manager repos --enable="rhel-7-server-optional-rpms"
    • subscription-manager repos --enable="rhel-7-server-devtools-rpms"
      ppc64le:
    • subscription-manager repos --enable="rhel-7-for-power-le-optional-rpms"
    • subscription-manager repos --enable="rhel-7-server-for-power-le-devtools-rpms"

CentOS 7 users needs to enable this repository if they want to install -devel subpackage:

  • yum -y install centos-release-scl

Advanced users can download the repository RPMs or the software RPMs for manual installation.