Skip to content

Your First Standard Repository

Build a standard repository that serves EL9 and Debian clients from one tree, then check it.

This walkthrough builds one standard repository that serves two kinds of clients: EL9 hosts through a YUM index and Debian hosts through an APT index. Along the way you will meet what a standard repository adds over a simple one: named package sets (Dists), a shared package pool, and a recorded build that you can verify before anyone downloads from it.

You need SOW, some RPM or DEB files (one of each format is enough), and an empty writable directory. The examples use /srv/sow; substitute a path under your home directory if you don’t have write access to /srv.

Initialize the workspace

sow init /srv/sow
cd /srv/sow

init creates the configuration file and the private state directory:

  • /srv/sow/
    • sow.ymlconfiguration you edit (schema: sow/v3)
    • .sow/databases, locks, and recovery records, managed by SOW

Running init again initializes newly declared repositories and Dists and can recreate a missing per-repository lock. If a populated workspace has lost .sow/workspace.lock, follow offline lock recovery.

Create a repository and two Dists

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

local is the repository, the directory you will serve. el9 and bookworm are Dists: named package sets of one format each. The names are labels you choose; for APT clients, bookworm will also be the suite name. These commands record both Dists in sow.yml for you.

Each Dist starts with valid, empty indexes for x86_64 and aarch64, so a client can already point at it:

  • /srv/sow/local/
    • pool/package files, shared by every Dist
    • dists/
      • el9/
        • x86_64/repodata/
        • aarch64/repodata/
      • bookworm/
        • Release
        • main/
          • binary-amd64/Packages, Packages.gz, by-hash/
          • binary-arm64/

Add packages

Tell add which Dist each batch belongs to:

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

For each file, SOW reads the name, version, and architecture from the package header, copies the file into local/pool/ once, adds it to the Dist, and rebuilds that Dist’s indexes. The summary line tells you how it went, followed by one item line per input:

add repository=local operation=3572843618681363018 accepted=2 failed=0 memberships=+2/-0 revision=1 generation=3 dirty=false

From now on SOW works from its pool; you can delete or move the original files.

Inspect and verify

sow status
sow ls -d el9
sow check

status should report status=clean ready_to_copy=true: membership and the built files agree, and the tree is ready to serve. ls lists each Dist’s packages with their pool paths. check re-reads every package and index, compares them with the recorded build, and exits 0 only if everything matches. Run it before you ship a build.

Serve the repository

Serve the repository directory /srv/sow/local, never the workspace root: sow.yml and .sow/ must not be reachable over HTTP. Clients need both dists/ and pool/, because the indexes point into the pool.

Serve and publish sets this up with Nginx. The YUM and APT tutorials show the client configuration.

Batch later updates

Each add rebuilds the affected Dists. When you import several batches, skip the build on each one and build once at the end:

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

Between the --skip imports and the build, sow status reports dirty and ready_to_copy=false, while the served tree still holds the previous build.

Selection rules

The commands above did not name a workspace or repository because SOW found them: it looks for sow.yml or sow.yaml in the current directory and its parents, and a workspace with a single repository selects it automatically. From another directory, add -C /srv/sow. Once a workspace holds several repositories, add -r local. -d NAME selects a Dist and can be repeated. The full rules are in Commands.

Next