Install Percona Distribution for PostgreSQL on Red Hat Enterprise Linux and derivatives¶
This document describes how to install Percona Distribution for PostgreSQL from Percona repositories on RPM-based distributions such as Red Hat Enterprise Linux and compatible derivatives. Read more about Percona repositories.
Platform specific notes¶
Depending on what operating system you are using, you may need to enable or disable specific modules to install Percona Distribution for PostgreSQL packages and to resolve dependencies conflicts for its specific components.
For Percona Distribution for PostgreSQL packages¶
Install the epel-release
package:
$ sudo yum -y install epel-release
$ sudo yum repolist
Disable the postgresql
module:
$ sudo dnf module disable postgresql
For percona-postgresql17-devel
package¶
You may need to install the percona-postgresql17-devel
package when working with some extensions or creating programs that interface with PostgreSQL database. This package requires dependencies that are not part of the Distribution, but can be installed from the specific repositories:
$ sudo yum --enablerepo=codeready-builder-for-rhel-8-rhui-rpms
$ sudo dnf install perl-IPC-Run -y
$ sudo dnf install dnf-plugins-core
$ sudo dnf config-manager --set-enabled powertools
$ sudo dnf config-manager --set-enabled ol8_codeready_builder
$ sudo dnf install perl-IPC-Run -y
$ sudo dnf install dnf-plugins-core
$ sudo dnf config-manager --set-enabled crb
$ sudo dnf install perl-IPC-Run -y
$ sudo dnf config-manager --set-enabled ol9_codeready_builder
$ sudo dnf install perl-IPC-Run -y
For percona-patroni
package¶
To install Patroni on Red Hat Enterprise Linux 9 and compatible derivatives, enable the epel
repository
$ sudo yum install epel-release
For pgpool2
extension¶
To install pgpool2
on Red Hat Enterprise Linux and compatible derivatives, enable the codeready builder repository first to resolve dependencies conflict for pgpool2
.
The following are commands for Red Hat Enterprise Linux 9 and derivatives. For Red Hat Enterprise Linux 8, replace the operating system version in the commands accordingly.
$ sudo dnf config-manager --set-enabled codeready-builder-for-rhel-9-x86_64-rpms
$ sudo dnf config-manager --set-enabled crb
$ sudo dnf config-manager --set-enabled ol9_codeready_builder
For PostGIS¶
For Red Hat Enterprise Linux 8 and derivatives, replace the operating system version in the following commands accordingly.
Run the following commands:
-
Install
epel
repository$ sudo yum install epel-release
-
Enable the codeready builder repository to resolve dependencies conflict.
$ sudo dnf config-manager --set-enabled codeready-builder-for-rhel-9-x86_64-rpms
Run the following commands:
-
Install
epel
repository$ sudo yum install epel-release
-
Enable the codeready builder repository to resolve dependencies conflict.
$ sudo dnf install dnf-plugins-core $ sudo dnf config-manager --set-enabled crb
Run the following commands:
-
Install
epel
repository$ sudo yum install epel-release
-
Enable the codeready builder repository to resolve dependencies conflict.
$ sudo dnf config-manager --set-enabled ol9_codeready_builder
Run the following commands:
-
Configure the Oracle-Linux repository. Create the
/etc/yum.repos.d/oracle-linux-ol9.repo
file to install the required dependencies:/etc/yum.repos.d/oracle-linux-ol9.repo[ol9_baseos_latest] name=Oracle Linux 9 BaseOS Latest ($basearch) baseurl=https://yum.oracle.com/repo/OracleLinux/OL9/baseos/latest/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=1 enabled=1 [ol9_appstream] name=Oracle Linux 9 Application Stream ($basearch) baseurl=https://yum.oracle.com/repo/OracleLinux/OL9/appstream/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=1 enabled=1 [ol9_codeready_builder] name=Oracle Linux 9 CodeReady Builder ($basearch) - Unsupported baseurl=https://yum.oracle.com/repo/OracleLinux/OL9/codeready/builder/$basearch/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle gpgcheck=1 enabled=1
-
Download the right GPG key for the Oracle Yum Repository:
$ wget https://yum.oracle.com/RPM-GPG-KEY-oracle-ol9 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
-
Install
epel
repository$ sudo yum install epel-release
-
Disable the upstream
postgresql
package:$ sudo dnf module disable postgresql
Procedure¶
Run all the commands in the following sections as root or using the sudo
command:
Install dependencies¶
Install curl
for Telemetry. We use it to better understand the use of our products and improve them.
$ sudo yum -y install curl
Configure the repository¶
-
Install the
percona-release
repository management tool to subscribe to Percona repositories:$ sudo yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
-
Enable the repository
Percona provides two repositories for Percona Distribution for PostgreSQL. We recommend enabling the Major release repository to timely receive the latest updates.
$ sudo percona-release setup ppg17
Install packages¶
The meta package enables you to install several components of the distribution in one go.
$ sudo yum install percona-ppg-server17
Run the following commands:
-
Install the PostgreSQL server package:
$ sudo yum install percona-postgresql17-server
-
Install the components:
Install
pg_repack
:$ sudo yum install percona-pg_repack17
Install
pgaudit
:$ sudo yum install percona-pgaudit17
Install
pgBackRest
:$ sudo yum install percona-pgbackrest
Install
Patroni
:$ sudo yum install percona-patroni
Install
pgBouncer
:$ sudo yum install percona-pgbouncer
Install
pgAudit-set_user
:$ sudo yum install percona-pgaudit17_set_user
Install
pgBadger
:$ sudo yum install percona-pgbadger
Install
wal2json
:$ sudo yum install percona-wal2json17
Install PostgreSQL contrib extensions:
$ sudo yum install percona-postgresql17-contrib
Install HAProxy
$ sudo yum install percona-haproxy
Install
pg_gather
$ sudo yum install percona-pg_gather
Install pgpool2
- Check the platform specific notes
-
Install the extension
$ sudo yum install percona-pgpool-II-pg17
Install pgvector package suite:
$ sudo yum install percona-pgvector_17 percona-pgvector_17-debuginfo percona-pgvector_17-debugsource percona-pgvector_17-llvmjit
Some extensions require additional setup in order to use them with Percona Distribution for PostgreSQL. For more information, refer to Enabling extensions.
Start the service¶
After the installation, the default database storage is not automatically initialized. To complete the installation and start Percona Distribution for PostgreSQL, initialize the database using the following command:
$ /usr/pgsql-17/bin/postgresql-17-setup initdb
Start the PostgreSQL service:
$ sudo systemctl start postgresql-17
Check the Percona Distribution for PostgreSQL version:
$ psql --version
Sample output
psql (PostgreSQL) 17.2.1 (Percona Server for PostgreSQL) 17.2.1
Congratulations! Your Percona Distribution for PostgreSQL is up and running.