pig repo

Manage software repositories with pig repo

The pig repo command is a comprehensive package repository manager. It can add, remove, create, and manage repositories on RPM systems (RHEL/CentOS/Rocky/Alma) and Debian systems (Debian/Ubuntu).

pig repo - Manage Linux APT/YUM Repo

  pig repo list                    # available repo list             (info)
  pig repo info   [repo|module...] # show repo info                  (info)
  pig repo status                  # show current repo status        (info)
  pig repo add    [repo|module...] # add repo and modules            (root)
  pig repo rm     [repo|module...] # remove repo & modules           (root)
  pig repo update                  # update repo pkg cache           (root)
  pig repo create                  # create repo on current system   (root)
  pig repo boot                    # boot repo from offline package  (root)
  pig repo cache                   # cache repo as offline package   (root)

Examples:
  pig repo add -ru                 # add all repo and update cache (brute but effective)
  pig repo add pigsty -u           # gentle version, only add pigsty repo and update cache
  pig repo add node pgdg pigsty    # essential repo to install postgres packages
  pig repo add all                 # all = node + pgdg + pigsty
  pig repo add all extra           # extra module has non-free and some 3rd repo for certain extensions
  pig repo update                  # update repo cache
  pig repo create                  # update local repo /www/pigsty meta
  pig repo boot                    # extract /tmp/pkg.tgz to /www/pigsty
  pig repo cache                   # cache /www/pigsty into /tmp/pkg.tgz
CommandDescriptionNotes
repo listPrint available repositories and modules
repo infoShow repository details
repo statusShow current repository status
repo addAdd repositoriesRequires sudo or root
repo setClear, overwrite, and update repositoriesRequires sudo or root
repo rmRemove repositoriesRequires sudo or root
repo updateUpdate repository cacheRequires sudo or root
repo createCreate local YUM/APT repositoryRequires sudo or root
repo cacheCreate offline package from local repoRequires sudo or root
repo bootBootstrap repository from offline packageRequires sudo or root
repo reloadRefresh repository catalog

Quick Start

# Method 1: clean existing repositories, add all required repos, and update cache (recommended)
pig repo add all --remove --update    # remove old repos, add all required repos, update cache

# Method 1 variant: one step
pig repo set                          # = pig repo add all --remove --update

# Method 2: gentle mode - only add required repos and keep current repo configuration
pig repo add pgsql                    # add PGDG and Pigsty PGSQL repositories
pig repo add pigsty --region=china    # add Pigsty repositories with China region
pig repo add pgdg   --region=europe   # add PGDG repositories with Europe region
pig repo add infra  --region=default  # add INFRA repositories with default region

# If the commands above did not use -u|--update, run this as an extra step
pig repo update                       # update system package cache

Modules

In pig, APT/YUM repositories are organized as modules: groups of repositories serving a specific purpose.

ModuleDescriptionRepository List
allAll core modules required to install PGnode + infra + pgsql
pgsqlPGDG + Pigsty PG extensionspigsty-pgsql + pgdg
pigstyPigsty Infra + PGSQL repositoriespigsty-infra, pigsty-pgsql
pgdgPGDG official repositoriespgdg-common, pgdg14-18
nodeLinux system repositoriesbase, updates, extras, epel, baseos, appstream…
infraInfrastructure component repositoriespigsty-infra, nginx, docker-ce
dockerDocker repositorydocker-ce
betaPostgreSQL 19 beta repositoriespgdg19-beta, pgdg-beta
extraPGDG non-free and third-party extensionspgdg-extras, timescaledb, citus
groongaPGroonga repositorygroonga
mssqlWiltonDB repository (deprecated)babelfish
perconaPercona PG + PG_TDEpercona
llvmLLVM toolchain repositoryllvm
kubeKubernetes repositorykubernetes
grafanaGrafana repositorygrafana
haproxyHAProxy repositorieshaproxyd, haproxyu
redisRedis repositoryredis
mongoMongoDB repositorymongo
mysqlMySQL repositorymysql
clickClickHouse repositoryclickhouse
gitlabGitLab repositorygitlab-ce, gitlab-ee

Pig also includes APT/DNF repositories for other databases and systems such as redis, kubernetes, grafana, clickhouse, gitlab, haproxy, mongodb, and mysql.

In general, node (Linux system repositories) and pgsql (PGDG + Pigsty) are required for PostgreSQL installation. The infra repository is optional and contains tools, IvorySQL kernel packages, and similar components. The special all module adds all required repositories at once and is a suitable starting point for most users.

pig repo add all      # add node, pgsql, and infra repositories
pig repo add          # default to the all module when no argument is given
pig repo set          # set clears/backups existing definitions and overwrites with new repo definitions

Repository Definitions

The full repository definition bundled with Pigsty is in cli/repo/assets/repo.yml.

You can create ~/.pig/repo.yml to explicitly modify and override pig’s repository definitions. When editing repository definitions, you can add extra regional mirror URLs under baseurl, such as China or Europe mirrors. When --region is specified, pig first looks for the matching regional URL and falls back to the default URL if the region is unavailable.

repo list

pig repo list lists all repository modules available on the current system.

pig repo list                # list repositories available on current system
pig repo list all            # list all repositories without filtering

repo info

Show detailed information for specific repositories or modules, including URLs, metadata, regional mirrors, and .repo / .list repository file content.

pig repo info pgdg               # show pgdg module information
pig repo info pigsty pgdg        # show multiple modules
pig repo info all                # show all modules

repo status

Show current repository configuration on the system.

pig repo status

repo add

Add repository configuration files to the system. Requires root/sudo privileges.

pig repo add pgdg                # add PGDG repository
pig repo add pgdg pigsty         # add multiple repositories
pig repo add all                 # add all required repositories (pgdg + pigsty + node)
pig repo add pigsty -u           # add and update cache
pig repo add all -r              # remove existing repos before adding
pig repo add all -ru             # remove, add, and update (full reset)
pig repo add pgdg --region=china # use China mirror

Options:

  • -r|--remove: remove existing repositories before adding new ones
  • -u|--update: run package cache update after adding repositories
  • --region <region>: use regional mirror repositories (default / china / europe)
PlatformModule Location
EL/etc/yum.repos.d/<module>.repo
Debian/etc/apt/sources.list.d/<module>.list

repo set

Equivalent to repo add --remove --update. It clears existing repositories, sets up new ones, then updates cache.

pig repo set                     # replace with default repositories
pig repo set pgdg pigsty         # replace with selected repositories and update
pig repo set all --region=china  # use China mirror

repo rm

Remove repository configuration files and back them up.

pig repo rm                      # remove all repositories
pig repo rm pgdg                 # remove selected repository
pig repo rm pgdg pigsty -u       # remove and update cache
PlatformBackup Location
EL/etc/yum.repos.d/backup/
Debian/etc/apt/sources.list.d/backup/

repo update

Update package-manager cache to reflect repository changes.

pig repo update                  # update package cache
PlatformEquivalent Command
ELdnf makecache
Debianapt update

repo create

Create a local package repository for offline installation.

pig repo create                  # create at default location (/www/pigsty)
pig repo create /srv/repo        # create at custom location
PlatformDependency
ELcreaterepo_c
Debiandpkg-dev

repo cache

Create a compressed tarball of repository contents for offline distribution.

pig repo cache                   # default: /www to /tmp/pkg.tgz
pig repo cache -d /srv           # custom source directory

Options:

  • -d, --dir: source directory, default /www/
  • -p, --path: output path, default /tmp/pkg.tgz

repo boot

Extract and set up a local repository from an offline package.

pig repo boot                    # default: /tmp/pkg.tgz to /www
pig repo boot -p /mnt/pkg.tgz    # custom package path
pig repo boot -d /srv            # custom target directory

Options:

  • -p, --path: package path, default /tmp/pkg.tgz
  • -d, --dir: target directory, default /www/

repo reload

Refresh repository metadata from GitHub to the latest version.

pig repo reload                  # refresh repository catalog

The updated file is placed in ~/.pig/repo.yml.


Last Modified 2026-07-04: bump pig to 1.5.0 (d55931d)