Skip to content

Installation

Install SOW from the Pigsty repository, a release package, an archive, or source, and upgrade an existing workspace.

SOW is a single executable. It needs no daemon, no database server, and no language runtime, and it parses packages and writes metadata itself, so there is no createrepo_c or dpkg to install either. Choose a channel:

Channel Platforms Choose it when
Pigsty repository Linux, amd64 / arm64 You want apt or dnf to install and update SOW
RPM or DEB package Linux, amd64 / arm64 You need a specific version, or an offline host
Archive Linux and macOS, amd64 / arm64 You are on macOS, or don’t want a system package
Source Linux or macOS (amd64 or arm64) You build your own binaries

Release packages, archives, and SHA256SUMS for SOW 0.9.0 are on the Download page.

From the Pigsty repository

SOW ships in the Pigsty infra repository. This channel is rolling: it installs the SOW version available in the configured repository. Use a tagged release asset when you need an exact version.

# 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 sow
# RHEL / Rocky / Alma and compatible
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 sow

These examples skip signature checks for the Pigsty source (trusted=yes, gpgcheck=0). In mainland China, replace repo.pigsty.io with the repo.pigsty.cc mirror.

Install a Linux package

Download the package for your architecture and SHA256SUMS, check the package against its line in SHA256SUMS, then install it:

# RPM, x86_64
sudo rpm -Uvh ./sow-0.9.0-1PGSTY.x86_64.rpm

# Debian or Ubuntu, amd64
sudo apt install ./sow_0.9.0-1PGSTY_amd64.deb

For ARM64, use the RPM ending in .aarch64.rpm or the DEB ending in _arm64.deb. The packages install the executable at /usr/bin/sow.

Install an archive

Download the archive and SHA256SUMS into an empty directory. For Linux amd64:

set -euo pipefail
grep -F '  sow_0.9.0_linux_amd64.tar.gz' SHA256SUMS | sha256sum -c -
tar -xzf sow_0.9.0_linux_amd64.tar.gz
sudo install -m 0755 sow /usr/local/bin/sow

On macOS, use darwin_amd64 or darwin_arm64 in the archive name and shasum -a 256 -c - for the checksum. Without root access, install into your home directory instead:

mkdir -p "$HOME/.local/bin"
install -m 0755 sow "$HOME/.local/bin/sow"
export PATH="$HOME/.local/bin:$PATH"   # also add this line to your shell profile

Build from source

You need Go 1.27.4 or newer and Git. SOW builds with CGO_ENABLED=0, so no C compiler is involved.

set -euo pipefail
git clone --branch v0.9.0 https://github.com/pgsty/sow.git
cd sow
SOW_BUILD_DIR="$(mktemp -d)"
CGO_ENABLED=0 go build -trimpath \
  -ldflags='-s -w -X github.com/pgsty/sow/internal/v2cli.Version=0.9.0' \
  -o "$SOW_BUILD_DIR/sow" ./cmd/sow
sudo install -m 0755 "$SOW_BUILD_DIR/sow" /usr/local/bin/sow

Verify the installation

sow version
sow help

sow version prints the version, platform, and Go toolchain, for example sow 0.9.0 linux/amd64 go1.27.4. sow help lists the commands, and sow help COMMAND shows one command’s options as implemented by the binary you have.

Storage and optional tools

The user running SOW needs read access to the input packages and write access to the repository. Put a workspace on a local POSIX filesystem (APFS on macOS); SOW relies on file locks, fsync, and atomic rename, which network filesystems do not reliably provide.

Signing is optional. Depending on how you sign, you may need host tools:

Signing method Required tools
Metadata signing with an OpenPGP key file or key material None
Metadata signing with a GPG key ID or fingerprint gpg and gpg-agent
RPM package signing rpm with a working GPG signing setup

Next: the Quick start for a simple repository, or Your first standard repository.

Upgrade to 0.9.0

Workspaces created by SOW 0.5.0 through 0.8.0 already use database schema v13, so there is no migration: install the new binary, rebuild, and check. Your sow/v3 configuration and public URLs stay as they are.

Warning

Check targets with max_cache_ttl: 0s first. Before 0.9.0, target GC kept superseded files for at least 30 days whatever the TTL. 0.9.0 uses max_cache_ttl as the grace period directly. With 0s, a filesystem target may delete eligible files at its next sow gc TARGET. R2 reports candidates unless you pass --delete. Recorded deadlines still protect older publications.

  1. Stop everything that writes to the workspace.
  2. Back up the complete workspace with a tool that preserves hard links, such as rsync -aH or tar.
  3. For each target with max_cache_ttl: 0s, decide whether clients need a longer window; set the required lifetime in sow.yml before the next publication.
  4. Install SOW 0.9.0.
  5. Build and check each repository listed in sow.yml:
sow version
sow build -r REPOSITORY -C /srv/sow
sow check -r REPOSITORY -C /srv/sow

REPOSITORY is the repository name from sow.yml. A repository with no pending changes produces a no-op build that keeps its Generation number and metadata timestamps, so clients see nothing new.

If you changed the TTL of an already published target, use sow publish TARGET --rebind when you are ready to deliver the checked build. A target that has never been published gets its settings on its first sow publish TARGET.

Local GC plans that were interrupted under 0.7.1 with an empty manifest array resume directly under 0.9.0. Before a downgrade, check the configuration against the target version. Versions through 0.8.0 require the name sow.yml. Versions through 0.6.1 also reject the passfile field.

Workspaces from 0.2, 0.3, or 0.4

Repositories created by 0.2.0, 0.3.0, and 0.4.0 use SQLite schemas v8, v10, and v12 respectively. SOW 0.9.0 can migrate each directly to v13. Stop writers and back up the complete workspace with hard links preserved. After installing 0.9.0, run these commands for each repository.

sow repo migrate REPOSITORY -C /srv/sow
sow build -r REPOSITORY -C /srv/sow
sow check -r REPOSITORY -C /srv/sow

repo migrate reports the old and new schema versions. build refreshes views that need rebuilding and may report noop=true if they are current. Finish by checking the whole repository. To go back to a version that uses the older schema, restore the backup. See sow repo migrate and the 0.9.0 release notes.

Upgrade instructions for earlier releases

Target version Upgrade notes
0.8.0 Finish interrupted 0.7.1 local GC before upgrading.
0.7.1 Existing schema v13 workspaces need no migration.
0.7.0 Check passfile compatibility before downgrading.
0.6.1 No migration from 0.5.0 or 0.6.0.
0.6.0 Check the publication time of simple YUM repositories.
0.5.0 Migrate standard repositories to schema v13.
0.4.0 Migrate a 0.3 workspace.
0.3.0 Migrate a 0.2.0 workspace from schema v8 to v10.

Upgrade a simple repository

A simple repository keeps no database, so upgrading is just installing the new binary. If you are switching an existing YUM repository from another generator to SOW, follow Migrate an existing YUM repository: --metadata-timestamp still defaults to 0, and clients with cached metadata need a timestamp derived from the repository’s publication history.

Table reader