sow rm
sow rm takes packages out of the selected Dists’ desired membership and rebuilds those Dists'
local indexes. Use it to withdraw a broken or unwanted package; preview the result with --check,
or stage several removals with --skip and build once. The package files stay in pool/, because
other Dists or retained Generations may still use them, until sow gc can
reclaim them. To drop a whole Dist, use sow dist rm.
Synopsis
PACKAGE is a package name, coordinate, file name, or sha256: reference; see
Package references. A --check preview can render signed metadata, so it
also accepts --passfile.
Options
| Flag | Description | Default |
|---|---|---|
-c, --check |
Preview only; compute and print the plan without writing anything | off |
--skip |
Update the 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 |
--passfile PATH |
Password file for this invocation | per-key config, then SOW_GPG_PASSFILE |
--json |
Output JSON | false |
--check and --skip are mutually exclusive, and --check takes no lock options:
Examples
Preview a removal, then apply it:
Remove one exact object from two Dists:
Stage several removals, then build once:
Feed the preview plan to another tool:
Package references
PACKAGE accepts five forms. Package References has the full
grammar and disambiguation rules.
| 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; every other
form must identify exactly one object, and an ambiguous one fails with the matching candidates.
sow ls prints exact sha256: references and canonical coordinates, so you
never have to assemble one by hand. A reference that matches nothing fails the whole command:
Preview with –check
-c/--check computes the removal and the local file changes it would make, without modifying the
repository or touching .sow/<repo>/stage. It validates the candidate configuration and the
existing state, and takes shared locks, so it waits for a running writer.
The bare name matched both centos-release versions. membership lines list the memberships your
references matched; change lines list the expected local file changes in
payload → metadata → pointer → delete order. If current policy would drop further members as a
result, their index changes appear among the change lines, and their count appears in
sow log after the real run. With --json, read the removed[] and
changes[] arrays.
The preview predicts membership removals, policy results, file paths, actions, Generation, and revision exactly, provided the references, selected Dists, repository state, configuration, and signing keys do not change before the real run. Index and signature bytes, hashes, and sizes can still differ: the real build records its own publication time, and non-deterministic signature algorithms such as ECDSA and DSA produce new bytes on every signing. Crash recovery reuses the metadata that the real run staged or installed, not the preview’s.
Default behavior: remove and rebuild
Without --check or --skip, rm commits the change to the desired state and rebuilds every affected Dist
before it returns:
One change line follows the summary for each affected file. Here only the two repomd.xml
pointers changed; the checksum-named metadata files they now reference were already in the tree.
--json returns the same result in the standard envelope.
Removing the last member of a Dist is fine: SOW still renders a valid empty index, signed if
signing is configured, such as an empty Packages with a verifiable InRelease or an empty
repodata/ per architecture.
–skip
--skip commits the change to the desired state and leaves the public tree untouched. The
repository becomes dirty when the desired state now differs from the built state; removing an
addition that was never built can return it
to clean without a build.
changes=0 because nothing was built. Run sow build to apply the pending changes.
Policy interaction
Removal does not bring back packages that policy dropped earlier. SOW re-applies policy to the
remaining members, so if you remove libpq5 18.3-1 from a limit: 1 Dist, the previously
excluded 18.2-1 stays excluded. Run sow add for it to restore it.
Exit codes
| Code | Trigger |
|---|---|
0 |
Memberships removed and Dists 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; SOW rejects the whole batch and removes no memberships |
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