快速上手

快速上手 pig 包管理器

简短版本

Linux EL Support: 8/9 Debian Support: 12 Ubuntu Support: 22/24

使用以下命令安装 pig 软件包:

curl -fsSL https://repo.pigsty.io/pig | bash      # 全球 CDN
curl -fsSL https://repo.pigsty.cc/pig | bash      # 中国 CDN

然后 pig 命令遍会在你的系统中可用。假设你想要安装 PostgreSQL 17 ,以及 pg_duckdb 扩展,那么从零开始只需要以下命令:

$ pig repo add pigsty pgdg -u  # 添加 pgdg & pigsty 仓库,然后更新仓库缓存
$ pig ext install pg17         # 从 PGDG 安装 PostgreSQL 17 原生内核包
$ pig ext install pg_duckdb    # (为当前默认PG17)安装 pg_duckdb 扩展插件

是的,一切都已经准备就绪。 pig 能干的事情远不止这些,你可以看看高级用法的说明,以及完整可用的 400+ 扩展列表

asciicast


正式安装

The pig util is a standalone go binary with no dependencies. You can install with the script:

curl -fsSL https://repo.pigsty.io/pig | bash   # cloudflare default
curl -fsSL https://repo.pigsty.cc/pig | bash   # mainland china mirror

Or just download and extract the binary, or use the apt/dnf package manager:

For Ubuntu 22.04 / 24.04 & Debian 12 or any compatible platforms:

sudo tee /etc/apt/sources.list.d/pigsty.list > /dev/null <<EOF
deb [trusted=yes] https://repo.pigsty.io/apt/infra generic main 
EOF
sudo apt update; sudo apt install -y pig

For EL 8/9 and compatible platforms:

sudo tee /etc/yum.repos.d/pigsty.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 yum makecache; sudo yum install -y pig

For mainland china user: consider replace the repo.pigsty.io with repo.pigsty.cc

pig has self update feature, you can update pig itself to the latest version with:

pig update

Or if you only want to update the extension catalog, you can fetch the latest catalog with:

pig ext upgrade




最后修改 2025-02-23: update extension doc (0a5bb32)