This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Extension Repo

How to use PostgreSQL extension YUM/APT repo on EL/Debian/Ubuntu and compatible os?

When deploying PostgreSQL with Pigsty, repo configure is handled automatically. You don’t need to manage repositories manually.

However, if you want to use the Pigsty extension repository independently (e.g., to install 400+ additional extensions for existing PostgreSQL deployments), this section will guide you through the process.

The PostgreSQL Global Development Group (PGDG) maintains the official YUM/APT repo for PostgreSQL. Pigsty provides a complementary repository (similar to EPEL for RHEL) that offers additional RPM/DEB packages for PostgreSQL extensions and ecosystem tools, maintaining full compatibility with PGDG’s build specifications.

The Pigsty extension repository supports both x86_64 and aarch64 architectures, organized into two sub-repositories:

  • pigsty-infra: Contains OS-version-independent infrastructure components (e.g., the Go-based vip-manager that works across different OS major version)
  • pigsty-pgsql: Provides OS-version-specific PostgreSQL extensions, supporting EL 8/9, Debian 12, and Ubuntu 22.04/24.04 - totaling 10 major version-architecture combinations.

For supported operating systems, we provide the pig CLI tool for repository and extension management. It handles:

You can also use it as a common YUM / APT repo that follow the traditional way

1 - PIG CLI

How to manage repo with the pig CLI tool?

Use the pig command-line tool to manage software repositories on Linux systems. Install it with:

curl https://repo.pigsty.cc/pig | bash

Add repositories with the following commands. The pig tool automatically detects your network conditions and selects the fastest mirror:

pig repo add pigsty   # Add PIGSTY repository
pig repo add pgdg     # Add PGDG repository
pig repo add pgsql    # Add PGDG + PIGSTY mirrors
pig repo add node     # Add OS default software repositories
pig repo add all      # Add PIGSTY + PGDG + NODE repositories

Repository files are written to /etc/yum.repos.d/ (EL) or /etc/apt/sources.list.d/ (Debian/Ubuntu).

To add all repositories and update the software cache:

pig repo add all -u   # Add NODE + PGSQL software repositories and update cache

To clear existing repositories and add new ones:

pig repo add all -ru  # remove + update
pig repo set          # Shorthand for the above command

Removed repository files are backed up to the relevant backup directory.

We recommend using this method to manage repositories, but you can also manually configure YUM/APT repositories if preferred.




2 - YUM Repo

How to use the Pigsty Extension YUM/DNF Repo on RHEL/Rocky Compatible OS?

You can use the following Shell commands to manually add the Pigsty repository GPG key, write the repository definition, and update the cache.

The default repo.pigsty.io repository is hosted on Cloudflare CDN, which may be slow for users in mainland China. You can use the China CDN mirror site repo.pigsty.cc instead of the default repo.pigsty.io repository:


Add Repo

For EL 8/9 and compatible systems, use the following commands to add the Pigsty repository GPG key, write the repository definition, and update the cache:

# Add Pigsty's GPG public key to your system keychain to verify package signatures
curl -fsSL https://repo.pigsty.io/key | sudo tee /etc/pki/rpm-gpg/RPM-GPG-KEY-pigsty >/dev/null

# Add Pigsty Repo definition files to /etc/yum.repos.d/ directory, including two repositories
sudo tee /etc/yum.repos.d/pigsty-io.repo > /dev/null <<-'EOF'
[pigsty-infra]
name=Pigsty Infra for $basearch
baseurl=https://repo.pigsty.io/yum/infra/$basearch
skip_if_unavailable = 1
enabled = 1
priority = 1
gpgcheck = 1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-pigsty
module_hotfixes=1

[pigsty-pgsql]
name=Pigsty PGSQL For el$releasever.$basearch
baseurl=https://repo.pigsty.io/yum/pgsql/el$releasever.$basearch
skip_if_unavailable = 1
enabled = 1
priority = 1
gpgcheck = 1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-pigsty
module_hotfixes=1
EOF

# Refresh YUM/DNF repository cache
sudo yum makecache;
# Add Pigsty's GPG public key to your system keychain to verify package signatures
curl -fsSL https://repo.pigsty.cc/key | sudo tee /etc/pki/rpm-gpg/RPM-GPG-KEY-pigsty >/dev/null

# Add Pigsty Repo definition files to /etc/yum.repos.d/ directory, including two repositories
sudo tee /etc/yum.repos.d/pigsty-cc.repo > /dev/null <<-'EOF'
[pigsty-infra]
name=Pigsty Infra for $basearch
baseurl=https://repo.pigsty.cc/yum/infra/$basearch
skip_if_unavailable = 1
enabled = 1
priority = 1
gpgcheck = 1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-pigsty
module_hotfixes=1

[pigsty-pgsql]
name=Pigsty PGSQL For el$releasever.$basearch
baseurl=https://repo.pigsty.cc/yum/pgsql/el$releasever.$basearch
skip_if_unavailable = 1
enabled = 1
priority = 1
gpgcheck = 1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-pigsty
module_hotfixes=1
EOF

# Refresh YUM/DNF repository cache
sudo yum makecache;

Repo Content

The pigsty-pgsql repository contains:

  • 208 PostgreSQL extension RPM packages (maintained by Pigsty, not included in PGDG YUM repository)
  • 215 PostgreSQL extension DEB packages (maintained by Pigsty, not included in PGDG APT repository)
  • haproxy 3.1
  • redis 7.2

The pigsty-infra repository contains:




3 - APT Repo

How to use the Pigsty Extension APT Repo on Debian/Ubuntu Compatible OS?

You can use the following Shell commands to manually add the Pigsty repository GPG key, write the repository definition, and update the cache.

The default repo.pigsty.io repository is hosted on Cloudflare CDN, which may be slow for users in mainland China. You can use the China CDN mirror site repo.pigsty.cc instead of the default repo.pigsty.io repository:


Add Repo

For Debian/Ubuntu and compatible systems, use the following commands to add the Pigsty repository GPG key, write the repository definition, and update the cache:

# Add Pigsty's GPG public key to your system keychain to verify package signatures
curl -fsSL https://repo.pigsty.io/key | sudo gpg --dearmor -o /etc/apt/keyrings/pigsty.gpg

# Get Debian distribution codename (distro_codename=jammy, focal, bullseye, bookworm), and write the corresponding upstream repository address to the APT List file
distro_codename=$(lsb_release -cs)
sudo tee /etc/apt/sources.list.d/pigsty-io.list > /dev/null <<EOF
deb [signed-by=/etc/apt/keyrings/pigsty.gpg] https://repo.pigsty.io/apt/infra generic main
deb [signed-by=/etc/apt/keyrings/pigsty.gpg] https://repo.pigsty.io/apt/pgsql ${distro_codename} main
EOF

# Refresh APT repository cache
sudo apt update
# Add Pigsty's GPG public key to your system keychain to verify package signatures
curl -fsSL https://repo.pigsty.cc/key | sudo gpg --dearmor -o /etc/apt/keyrings/pigsty.gpg

# Get Debian distribution codename (distro_codename=jammy, focal, bullseye, bookworm), and write the corresponding upstream repository address to the APT List file
distro_codename=$(lsb_release -cs)
sudo tee /etc/apt/sources.list.d/pigsty-io.list > /dev/null <<EOF
deb [signed-by=/etc/apt/keyrings/pigsty.gpg] https://repo.pigsty.cc/apt/infra generic main
deb [signed-by=/etc/apt/keyrings/pigsty.gpg] https://repo.pigsty.cc/apt/pgsql/${distro_codename} ${distro_codename} main
EOF

# Refresh APT repository cache
sudo apt update

Repo Content

The pigsty-pgsql repository contains:

  • 208 PostgreSQL extension RPM packages (maintained by Pigsty, not included in PGDG YUM repository)
  • 215 PostgreSQL extension DEB packages (maintained by Pigsty, not included in PGDG APT repository)
  • haproxy 3.1
  • redis 7.2

The pigsty-infra repository contains:




4 - GPG Key

Signing key for Pigsty repository RPM/DEB packages.

All the RPM/DEB packages are signed with GPG key fingerprint (B9BD8B20) in Pigsty repository.

Full: 9592A7BC7A682E7333376E09E7935D8DB9BD8B20 Ruohang Feng (Pigsty) [email protected]

pub   rsa4096 2024-07-16 [SC]
      9592A7BC7A682E7333376E09E7935D8DB9BD8B20
uid           [ultimate] Ruohang Feng (Pigsty) <[email protected]>
sub   rsa4096 2024-07-16 [E]

Import GPG Key

On RHEL/Rocky compatible Linux distributions, you can import this key with the following command:

curl -fsSL https://repo.pigsty.io/key | sudo tee /etc/pki/rpm-gpg/RPM-GPG-KEY-pigsty >/dev/null
curl -fsSL https://repo.pigsty.cc/key | sudo tee /etc/pki/rpm-gpg/RPM-GPG-KEY-pigsty >/dev/null

On Debian/Ubuntu compatible Linux distributions, you can import this key with the following command:

curl -fsSL https://repo.pigsty.io/key | sudo gpg --dearmor -o /etc/apt/keyrings/pigsty.gpg
curl -fsSL https://repo.pigsty.cc/key | sudo gpg --dearmor -o /etc/apt/keyrings/pigsty.gpg

Public Key

You can download GPG public key from:

And corresponding public key block is:

-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBGaV5PwBEACbErI+7yOrsXTT3mR83O6Fw9WyHJqozhyNPF3dA1gAtWpfWqd4
S9x6vBjVwUbIRn21jYgov0hDiaLABNQhRzifvVr0r1IjBW8lhA8zJGaO42Uz0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