Software Repository

Managing local APT/YUM software repositories

Pigsty supports creating and managing local APT/YUM software repositories for offline deployment or accelerated package installation.


Quick Start

To add packages to the local repository:

  1. Add packages to repo_packages (default packages)
  2. Add packages to repo_extra_packages (extra packages)
  3. Run the build command:
./infra.yml -t repo_build   # Build local repo from upstream
./node.yml -t node_repo     # Refresh node repository cache

Package Aliases

Pigsty predefines common package combinations for batch installation:

EL Systems (RHEL/CentOS/Rocky)

AliasDescription
node-bootstrapAnsible, Python3 tools, SSH related
infra-packageNginx, etcd, HAProxy, monitoring exporters, MinIO
pgsql-utilityPatroni, pgBouncer, pgBackRest, PG tools
pgsqlFull PostgreSQL (server, client, extensions)
pgsql-miniMinimal PostgreSQL installation

Debian/Ubuntu Systems

AliasDescription
node-bootstrapAnsible, development tools
infra-packageInfrastructure components (Debian naming)
pgsql-clientPostgreSQL client
pgsql-serverPostgreSQL server and related packages

Playbook Tasks

Main Tasks

TaskDescription
repoCreate local repo from internet or offline packages
repo_buildBuild from upstream if not exists
repo_upstreamAdd upstream repository files
repo_pkgDownload packages and dependencies
repo_createCreate/update YUM or APT repository
repo_nginxStart Nginx file server

Complete Task List

./infra.yml -t repo_dir          # Create local repository directory
./infra.yml -t repo_check        # Check if local repo exists
./infra.yml -t repo_prepare      # Use existing repo directly
./infra.yml -t repo_build        # Build repo from upstream
./infra.yml -t repo_upstream     # Add upstream repositories
./infra.yml -t repo_remove       # Delete existing repo files
./infra.yml -t repo_add          # Add repo to system directory
./infra.yml -t repo_url_pkg      # Download packages from internet
./infra.yml -t repo_cache        # Create metadata cache
./infra.yml -t repo_boot_pkg     # Install bootstrap packages
./infra.yml -t repo_pkg          # Download packages and dependencies
./infra.yml -t repo_create       # Create local repository
./infra.yml -t repo_use          # Add new repo to system
./infra.yml -t repo_nginx        # Start Nginx file server

Common Operations

Add New Packages

# 1. Configure upstream repositories
./infra.yml -t repo_upstream

# 2. Download packages and dependencies
./infra.yml -t repo_pkg

# 3. Build local repository metadata
./infra.yml -t repo_create

Refresh Node Repositories

./node.yml -t node_repo    # Refresh repository cache on all nodes

Complete Repository Rebuild

./infra.yml -t repo        # Create repo from internet or offline packages

Last modified 2026-01-06: batch update (cc9e058)