Skip to content

This is the multi-page printable view of this section. .

Return to the regular view of this page.

Get Started

Install SOW, create a flat repository, and learn the Managed workspace model.

SOW turns RPM and DEB files into static YUM and APT repositories. Install SOW, then choose how to manage your packages:

  • Plain mode: run sow create DIR to build indexes for the packages in a directory.

  • Managed mode: create a workspace to group packages into Dists, limit versions, sign metadata, and publish updates.

  • Installation — Install a release archive, Linux package, or source build.

  • Quick Start — Build a flat repository and use it from a local client.

  • First Workspace — Create RPM and DEB Dists, add packages, and check the result.

  • Core Concepts — Learn how workspaces, repositories, Dists, and generations fit together.

Serve the generated files through a static HTTP server or object storage. See Installation for storage and signing requirements.

1 - Installation

Install SOW from an archive, RPM/DEB package, or source, then verify the binary and filesystem requirements.

SOW is one executable. It needs no daemon, database service, or language runtime. Release archives support Linux and macOS on amd64 and arm64. Linux also has RPM and DEB packages.

These docs target SOW 0.7.0, currently a draft release. Until it is public, the Download page and binary installation examples below use the published 0.6.1 artifacts. The source-build and upgrade sections target 0.7.0. Download it and SHA256SUMS into a separate download directory.

Install an archive

For Linux amd64, verify the archive, extract it, and install the executable:

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

For macOS, select darwin_amd64 or darwin_arm64. Substitute that archive name and use shasum -a 256 -c - for the checksum command.

To install without root access:

mkdir -p "$HOME/.local/bin"
install -m 0755 sow "$HOME/.local/bin/sow"
export PATH="$HOME/.local/bin:$PATH"

Add the export PATH line to your shell profile to keep it in new sessions.

Install a Linux package

Verify the downloaded package against its entry in SHA256SUMS. Then run the command for your distribution:

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

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

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

Build from source

Install Go 1.27.3 or newer and Git. The build uses CGO_ENABLED=0 and needs no C compiler.

set -euo pipefail
git clone --branch v0.7.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.7.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

version shows the product version, target operating system and architecture, and Go toolchain. help lists commands. Use sow help COMMAND for a command’s options.

Upgrade to 0.7.0

SOW 0.7.0 keeps database schema v13, configuration schema sow/v3, and the public directory layout. Workspaces already on 0.5.0 through 0.6.1 need no schema migration. A configuration using passfile cannot be loaded by 0.6.1 or older; remove those keys before downgrading. Repositories affected by a retained migration anchor after later builds recover in 0.7.0 without manual repair.

  1. Stop all workspace writers.
  2. Back up the complete workspace with a tool that preserves hard links, such as rsync -aH or tar.
  3. Install SOW 0.7.0.
  4. Build and check each Repository in sow.yml:
sow version
sow build -r REPOSITORY -C /srv/sow
sow check -r REPOSITORY -C /srv/sow

Replace REPOSITORY with its configured name. A current repository produces a no-op build. An unchanged build keeps its Generation and metadata timestamps. New builds record one publication time and reuse it during recovery.

Workspaces from 0.3 or 0.4

These workspaces need migration before the first build. After backing up the workspace and installing 0.7.0, run:

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

Repeat these commands for each Repository. Migration updates the database; the rebuild applies the current RPM verification and APT metadata rules. Keep the backup for rollback to a version that uses an older schema. See sow repo migrate and the 0.6.0 release notes.

Upgrade a Plain repository

Plain mode has no database to migrate. For an existing YUM repository, follow Migrate an Existing YUM Repository before changing its generator. The --metadata-timestamp default remains 0. Set the timestamp from the repository’s publication history so cached YUM clients accept the new index.

Storage and optional tools

The SOW user needs read access to input packages and write access to the repository. Keep Managed workspaces on a local POSIX filesystem with file locks, fsync, and atomic rename.

Package parsing and metadata generation run inside SOW. Optional signing needs these host tools:

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

Continue with Quick Start for Plain mode or First Workspace for Managed mode.

2 - Quick Start

Index a directory of RPM and DEB packages, serve it, and configure a client.

Use Plain mode to build a repository from a directory of packages. It works without a workspace or configuration file. You need SOW, Python 3 for the preview, and at least one RPM or DEB file.

Prepare a directory

Create a writable directory. Replace the input paths below and run the copy command for each package format you have:

mkdir -p "$HOME/sow-quickstart"
cp /path/to/example.rpm "$HOME/sow-quickstart/"
cp /path/to/example.deb "$HOME/sow-quickstart/"

Keep packages at the directory top level; sow create does not scan subdirectories.

Generate metadata

sow create "$HOME/sow-quickstart"

With one RPM and one DEB, the output includes:

rpm=1 deb=1 signed=0 removed=0 marker=false noop=false recovered=false

The directory now has indexes beside the original packages:

sow-quickstart/
├── example.rpm
├── example.deb
├── repodata/       # RPM index and metadata
├── Packages        # DEB flat index
└── Packages.gz

SOW creates indexes for the formats present. Plain mode does not create APT Release, InRelease, or Release.gpg files. It leaves package names and paths unchanged.

Start a local server

Run this command in a separate terminal and leave it running:

python3 -m http.server --bind 127.0.0.1 --directory "$HOME/sow-quickstart" 8080

If this host has no APT or DNF client, check the HTTP entry point for the format you added:

# RPM
curl --fail http://127.0.0.1:8080/repodata/repomd.xml >/dev/null

# DEB
curl --fail http://127.0.0.1:8080/Packages.gz >/dev/null

This server is reachable only from the same host. For other clients or a persistent service, follow Serve Repositories.

Configure a local client

On a Linux host running the preview server, create the source file for your package manager. These examples use unsigned metadata and disable client signature checks. For signed metadata, use a Managed workspace and the signing tutorial.

Save this as /etc/yum.repos.d/sow-quickstart.repo:

[sow-quickstart]
name=SOW Quick Start
baseurl=http://127.0.0.1:8080/
enabled=1
gpgcheck=0
repo_gpgcheck=0

Refresh the index and install one of your packages:

sudo dnf --disablerepo='*' --enablerepo=sow-quickstart makecache
sudo dnf install PACKAGE_NAME

Save this as /etc/apt/sources.list.d/sow-quickstart.list:

deb [trusted=yes] http://127.0.0.1:8080/ ./

The final ./ selects a flat repository. Refresh the index and install one of your packages:

sudo apt update
sudo apt install PACKAGE_NAME

Replace PACKAGE_NAME with a package name from its metadata, not its filename. On macOS, use the HTTP checks above; run package installation on a compatible Linux client.

Update the repository

Add or remove package files, then regenerate the indexes:

sow create "$HOME/sow-quickstart"

Unchanged package files and options produce the same metadata. A repeat run reports noop=true.

When replacing another YUM metadata generator, follow Migrate an Existing YUM Repository to preserve the timestamp that cached clients expect.

When the preview is complete, stop the server with Ctrl+C and remove its source file from your client. Keep the package directory if you want to reuse it.

Next

Use a Managed workspace for named Dists, architecture views, version limits, signed metadata, and publication targets. See sow create for all Plain options.

3 - Your First Workspace

Create a workspace, organize RPM and DEB packages, and check the repository.

This example creates a Managed repository with two named package sets, called Dists: el9 for RPMs and bookworm for DEBs. Use an empty, writable /srv/sow directory, or substitute another path.

Initialize the workspace

sow init /srv/sow
cd /srv/sow

init creates:

/srv/sow/
├── sow.yml   # configuration; schema: sow/v3
└── .sow/     # private state managed by SOW

Edit sow.yml when you need to change configuration. SOW manages the private .sow/ directory. You can repeat init without resetting existing packages or state.

Create a Repository and two Dists

sow repo new local
sow dist new el9 --format rpm
sow dist new bookworm --format deb

Each Dist has one package format. dist new creates empty indexes for x86_64 and aarch64 by default. Both Dists share the Repository’s pool/ directory.

The public layout is now:

/srv/sow/local/
├── pool/
└── dists/
    ├── el9/
    │   ├── x86_64/repodata/
    │   └── aarch64/repodata/
    └── bookworm/
        ├── Release
        └── main/
            ├── binary-amd64/{Packages,Packages.gz,by-hash/}
            └── binary-arm64/{Packages,Packages.gz,by-hash/}

Add packages

Select the target Dist explicitly:

sow add /path/to/packages/*.rpm -d el9
sow add /path/to/packages/*.deb -d bookworm

Replace the input paths with real package files. SOW reads package identity and architecture, stores each accepted file in local/pool/, updates membership, and builds the affected Dists. Later builds use the pool, so the original input files are no longer needed by SOW.

Inspect and verify

sow status
sow ls -d el9
sow ls -d bookworm
sow check

ls lists the packages in each Dist. status should report clean and ready_to_copy=true. A successful check confirms that the files match the recorded build.

Serve the Repository

Publish the complete /srv/sow/local directory so clients can reach both indexes and package files. Keep the workspace configuration and .sow/ outside the server root.

Follow Serve Repositories to publish with Nginx. The YUM and APT tutorials show client configuration, including the trust settings for unsigned repositories.

Batch later updates

When you need to add several batches, use --skip and build once at the end:

sow add /path/to/more/*.rpm -d el9 --skip
sow build

While membership changes await a build, sow status reports dirty and ready_to_copy=false.

Selection rules

The commands above find the workspace from the current directory and select its only Repository. From another directory, use -C /srv/sow. With multiple Repositories, add -r local. Use -d NAME to select a Dist; repeat it to select several.

See selection rules for discovery and defaults.

Next

4 - Core Concepts

The SOW model: Plain and Managed execution, pools and views, Desired Membership, and Built Generations.

Choose a mode

Need Plain Managed
Build indexes from a package directory sow create DIR Import packages with sow add
Keep configuration and package membership Directory contents are the state sow.yml and private SQLite databases
Organize packages One flat directory; RPM and DEB can coexist Named Dists; one format per Dist
Publish architecture views No Yes
Apply filters and version limits Pigsty conventions with --pigsty Configurable per Dist
Sign RPM packages Yes Yes
Sign repository metadata Sign separately Configure keys in sow.yml
Track generations and publication Manage these outside SOW Built in

Use Plain when the directory already contains the packages you want to publish. Use Managed when SOW should track membership and maintain the repository over time.

Workspace, Repository, and Dist

Workspace                    /srv/sow
├── sow.yml                  configuration
├── .sow/                    private state
└── Repository               /srv/sow/local
    ├── pool/                package files
    └── dists/
        └── Dist             a named RPM or DEB package set
            └── views        metadata for each architecture

A workspace holds configuration and private state for one or more repositories.

A Repository owns a package pool, Dists, build history, and publication targets. Serve its complete pool/ and dists/ tree. Keep sow.yml and .sow/ outside the HTTP document root.

A Dist selects packages of one format. For example, el9 can contain RPMs and bookworm can contain DEBs. You choose the names; SOW does not check whether a package is compatible with the operating system named by its Dist.

An architecture view contains metadata for one architecture. SOW includes neutral RPM noarch and DEB all packages in each applicable view.

Store each package once

SOW identifies a package object by the SHA-256 of the complete package file. It reads the package name, version, and architecture from package metadata.

Within a Repository, each accepted package has one path under pool/. Multiple Dists can refer to that path. Separate repositories have separate pools.

RPM metadata uses relative paths back to the pool. APT Packages entries use paths relative to the Repository root. Keep the complete Repository tree together when you serve or copy it.

Some mirror tools, including default dnf reposync, reject the parent-relative RPM paths. Use sow export rpm-leaf to create a standalone RPM repository for those tools.

Desired membership and built generations

Desired membership is the package set selected for each Dist. A Generation identifies a completed build and its file manifest. Built Generation is the current completed build. Package files stay in the shared pool; each build does not create another copy.

add / rm → Desired membership → build → Built Generation

add and rm normally update membership and build the affected Dists in one command. With --skip, they update membership only. Run sow build after a batch of skipped changes, or after changing build or signing configuration.

Command Use
sow status Read the current state and ready_to_copy value
sow check Check package files, indexes, signatures, and recorded state without changing them
sow changes [BASE_GENERATION] List file changes from a recorded generation to the current build
sow publish TARGET Check and publish the current build to a configured target

Understand repository state

State Meaning Next action
clean Membership and configuration match the built output Ready for check or publication
dirty Membership or configuration needs a build Run build, then check
recovering An interrupted operation needs recovery Follow the error and recovery steps
error Stored state or files conflict Inspect the reported error and operation log

Use sow log to inspect failed or interrupted operations.

Continue