sow rm
sow rm removes packages from the selected Dists and rebuilds their local indexes. Use --check to preview the removal, or --skip to postpone the build. Package files remain in pool/ until sow gc can reclaim them.
Synopsis
Options
| Flag | Description | Default |
|---|---|---|
-c, --check |
Preview only; compute and print the plan without writing anything | off |
--skip |
Update Desired state only; do not build | off |
-j, --jobs N |
Parallel workers | logical CPU count |
-C, --workdir DIR |
Workspace discovery start directory | current directory |
-r, --repo NAME |
Select a repository | selection rules |
-d, --dist NAME |
Select a distribution; repeatable | selection rules |
-T, --timeout DUR |
Maximum lock wait; 0 waits indefinitely |
0 |
-N, --no-wait |
Fail immediately when the lock is held | false |
--json |
Output JSON | false |
--check and --skip are mutually exclusive:
Package references
PACKAGE accepts five forms. The full grammar and disambiguation rules are on
Package References; the short version:
| Form | Example |
|---|---|
| Content hash | sha256:d6f332ed157de1d42058ec785b392a1cc4b5836c27830af8fbf083cce29ef0ab |
| RPM coordinate | rpm:epel-release-0:7-5.noarch |
| DEB coordinate | deb:libpq5=18.3-1:amd64 |
| Full filename | epel-release-7-5.noarch.rpm |
| Bare binary name | epel-release |
A bare name matches every version and architecture of that name in the selected Dists. Other reference forms must identify one object. An ambiguous reference returns an error with the matching candidates.
sow ls prints exact sha256: references and canonical coordinates,
so you never have to assemble one by hand.
If no package matches a reference, the command returns an error:
Default behavior: remove and rebuild
Without --check or --skip, rm commits the Desired change and rebuilds every affected Dist
before returning. Pool objects stay on disk.
The summary is followed by one change line per affected file (eight in this run). Add --json to
receive the same result as a stable standard envelope.
Removing the last member of a Dist is fine. SOW still renders a valid, signed-if-configured empty
index — an empty Packages with a verifiable InRelease, or empty per-architecture repodata/.
Preview with –check
-c/--check previews the removal and resulting local file changes without modifying the Repository. removed lists memberships matched by your references. If the current policy removes additional members, their index changes appear in changes; their membership count appears in sow log after the removal runs.
Both centos-release versions matched the bare name. The change lines describe the expected local file changes in payload → metadata → pointer → delete order. Use --json to read the removed[] and changes[] arrays in a script.
Preview validates the candidate configuration and existing state. It uses shared locks and can wait for a writer, but does not accept --timeout or --no-wait:
–skip
--skip commits the Desired change and leaves the public tree unchanged. The Repository is dirty if the resulting Desired state differs from Built state. Removing a pending-only addition can return it to clean without a build.
changes is empty because nothing was built. Run sow build to
build the pending changes.
Policy interaction
After removal, SOW applies policy to the remaining members. If you remove libpq5 18.3-1 from a limit: 1 Dist, the previously excluded 18.2-1 stays excluded. Run sow add to restore it.
Examples
Preview a removal, then apply it:
Remove one exact object from two Dists with one command:
Batch several removals, then rebuild once:
Feed the preview plan to another tool:
Exit codes
| Code | Trigger |
|---|---|
0 |
Memberships removed and rebuilt, or a --check preview printed |
1 |
Runtime I/O or renderer failure |
2 |
Usage error — --check with --skip, --check with lock flags, ambiguous selection, Workspace not found |
4 |
Repository lock held and --no-wait given or --timeout expired |
5 |
Integrity or recovery error |
6 |
A reference matched nothing, or a non-bare reference was ambiguous; the whole batch is rejected and no memberships are removed |
See also
- Package References — the full reference grammar
sow ls,show, andwhere— finding the exact reference to remove- sow add — the inverse operation
- sow build — build after
--skip - Membership Policy — why removed members do not come back
sow retainandsow gc— when bytes can be reclaimed