Skip to content

Installation

How to download and install the pig package manager

Install PIG with the Linux installer, a system package, or a release archive. The current version is v1.10.0. The download page lists all release files.

Script installation

On Linux, run:

curl -fsSL https://repo.pigsty.io/pig | bash

In mainland China, use:

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

The script detects the architecture, downloads the RPM or DEB package, and installs it with rpm or dpkg. Installation requires root or sudo access.

Check the installed version:

pig version

To select a published version, pass its version number:

curl -fsSL https://repo.pigsty.io/pig | bash -s 1.10.0

Download release artifacts

Choose a file for your operating system and architecture on the download page or GitHub release.

SystemFormatArchitecture names
ELRPMx86_64, aarch64
Debian, UbuntuDEBamd64, arm64
Linuxtar.gzamd64, arm64
macOStar.gzamd64 (Intel), arm64 (Apple Silicon)

For a release archive, extract it and install the pig executable in a directory on your PATH. For example, on Apple Silicon:

curl -fLO https://github.com/pgsty/pig/releases/download/v1.10.0/pig-v1.10.0.darwin-arm64.tar.gz
tar -xzf pig-v1.10.0.darwin-arm64.tar.gz
sudo mkdir -p /usr/local/bin
sudo install -m 0755 pig /usr/local/bin/pig
pig version

The release includes SHA-256 checksums. Use sha256sum on Linux or shasum -a 256 on macOS to compare your downloaded file with its listed hash.

The macOS binary supports catalog queries, inventory editing, and other commands that do not need Linux package managers. Install PostgreSQL packages on a supported Linux host.

Repository installation

To manage PIG with the system package manager, add the Pigsty Infra repository. Choose the tab for your host:

APT (Debian / Ubuntu)
sudo tee /etc/apt/sources.list.d/pigsty-infra.list > /dev/null <<EOF
deb [trusted=yes] https://repo.pigsty.io/apt/infra generic main
EOF

sudo apt update
sudo apt install -y pig
DNF (EL)
sudo tee /etc/yum.repos.d/pigsty-infra.repo > /dev/null <<-'EOF'
[pigsty-infra]
name=Pigsty Infra for $basearch
baseurl=https://repo.pigsty.io/yum/infra/$basearch
enabled=1
gpgcheck=0
module_hotfixes=1
EOF

sudo dnf makecache
sudo dnf install -y pig

These definitions disable signature checks for the Pigsty repository. For key handling and verification settings, see repository keys.

Update

On Linux, update the executable with:

sudo pig update

Use -m for the China mirror or -v 1.10.0 to select that version. For an archive installation on macOS, download the new archive and replace the installed executable.

Refresh the extension catalog separately:

pig ext reload

This updates catalog metadata, leaving installed packages unchanged.

Uninstall

Choose the command that matches your installation:

sudo apt remove pig              # Debian / Ubuntu package
sudo dnf remove pig              # EL package
sudo rm /usr/local/bin/pig        # Archive installed at this path

If you installed the archive elsewhere, remove that executable instead. PostgreSQL and its extensions continue to run without PIG.

Build from source

Install Git, Make, and the Go toolchain specified in the project’s go.mod. Build the current release:

git clone --branch v1.10.0 https://github.com/pgsty/pig.git
cd pig
go mod download
make build
./pig version

make build produces ./pig for the current platform. The release workflow uses GoReleaser to produce RPM, DEB, and tar.gz files.

Continue with Getting started to install PostgreSQL and enable an extension.

Was this page helpful?