# Installing &repmgr; from packages

We recommend installing &repmgr; using the available packages for your system.

## RedHat/CentOS/Fedora

&repmgr; RPM packages for RedHat/CentOS variants and Fedora are available from the 2ndQuadrant public repository; see following section for details.

RPM packages for &repmgr; are also available via Yum through the PostgreSQL Global Development Group RPM repository (http://yum.postgresql.org/). Follow the instructions for your distribution (RedHat, CentOS, Fedora, etc.) and architecture as detailed there. Note that it can take some days for new &repmgr; packages to become available via the this repository.

&repmgr; RPM packages are designed to be compatible with the community-provided PostgreSQL packages and 2ndQuadrant's 2ndQPostgres. They may not work with vendor-specific packages such as those provided by RedHat for RHEL customers, as the PostgreSQL filesystem layout may be different to the community RPMs. Please contact your support vendor for assistance.

See also FAQ entry .

For more information on the package contents, including details of installation paths and relevant service commands, see the appendix section .

### 2ndQuadrant public RPM yum repository

2ndQuadrant provides a dedicated `yum` public repository for 2ndQuadrant software, including &repmgr;. We recommend using this for all future &repmgr; releases.

General instructions for using this repository can be found on its homepage. Specific instructions for installing &repmgr; follow below.

Installation

- Locate the repository RPM for your PostgreSQL version from the list at: https://dl.2ndquadrant.com/

- Install the repository definition for your distribution and PostgreSQL version (this enables the 2ndQuadrant repository as a source of &repmgr; packages).

  For example, for PostgreSQL 11 on CentOS, execute:

      curl https://dl.2ndquadrant.com/default/release/get/11/rpm | sudo bash

  For PostgreSQL 9.6 on CentOS, execute:

      curl https://dl.2ndquadrant.com/default/release/get/9.6/rpm | sudo bash

  Verify that the repository is installed with:

      sudo yum repolist

  The output should contain two entries like this:

      2ndquadrant-dl-default-release-pg11/7/x86_64         2ndQuadrant packages (PG11) for 7 - x86_64               18
      2ndquadrant-dl-default-release-pg11-debug/7/x86_64   2ndQuadrant packages (PG11) for 7 - x86_64 - Debug        8

- Install the &repmgr; version appropriate for your PostgreSQL version (e.g. `repmgr10`):

      sudo yum install repmgr11

  For packages for PostgreSQL 9.6 and earlier, the package name does not contain a period between major and minor version numbers, e.g. `repmgr96`.

  To determine the names of available packages, execute:

      yum search repmgr

Compatibility with PGDG Repositories

The 2ndQuadrant &repmgr; yum repository packages use the same definitions and file system layout as the main PGDG repository.

Normally yum will prioritize the repository with the most recent &repmgr; version. Once the PGDG repository has been updated, it doesn't matter which repository the packages are installed from.

To ensure the 2ndQuadrant repository is always prioritised, install `yum-plugin-priorities` and set the repository priorities accordingly.

Installing a specific package version

To install a specific package version, execute `yum --showduplicates list` for the package in question:

    [root@localhost ~]# yum --showduplicates list repmgr11
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: ftp.tsukuba.wide.ad.jp
     * epel: nrt.edge.kernel.org
     * extras: ftp.tsukuba.wide.ad.jp
     * updates: ftp.tsukuba.wide.ad.jp
    Installed Packages
    repmgr11.x86_64                        4.4.0-1.rhel7                         @pgdg11
    Available Packages
    repmgr11.x86_64                        4.2-1.el7                             2ndquadrant-dl-default-release-pg11
    repmgr11.x86_64                        4.2-2.el7                             2ndquadrant-dl-default-release-pg11
    repmgr11.x86_64                        4.3-1.el7                             2ndquadrant-dl-default-release-pg11
    repmgr11.x86_64                        4.4-1.el7                             2ndquadrant-dl-default-release-pg11

then append the appropriate version number to the package name with a hyphen, e.g.:

    [root@localhost ~]# yum install repmgr11-4.3-1.el7

Installing old packages

See appendix Installing old package versions for details on how to retrieve older package versions.

## Debian/Ubuntu

.deb packages for &repmgr; are available from the PostgreSQL Community APT repository (http://apt.postgresql.org/). Instructions can be found in the APT section of the PostgreSQL Wiki (https://wiki.postgresql.org/wiki/Apt).

For more information on the package contents, including details of installation paths and relevant service commands, see the appendix section .

### 2ndQuadrant public apt repository for Debian/Ubuntu

2ndQuadrant provides a public apt repository for 2ndQuadrant software, including &repmgr;.

General instructions for using this repository can be found on its homepage. Specific instructions for installing &repmgr; follow below.

Installation

- Install the repository definition for your distribution and PostgreSQL version (this enables the 2ndQuadrant repository as a source of &repmgr; packages) by executing:

                    curl https://dl.2ndquadrant.com/default/release/get/deb | sudo bash

  This will automatically install the following additional packages, if not already present:

  - `lsb-release`

  - `apt-transport-https`

- Install the &repmgr; version appropriate for your PostgreSQL version (e.g. `repmgr11`):

                    sudo apt-get install postgresql-11-repmgr

  For packages for PostgreSQL 9.6 and earlier, the package name includes a period between major and minor version numbers, e.g. `postgresql-9.6-repmgr`.

Installing old packages

See appendix Installing old package versions for details on how to retrieve older package versions.