# Barn 0.5.0: explicit disposal, explicit repositories, reproducible images

> A no-confirmation whole-lab purge, explicit global and China repository selection, no hidden artifact fallback, and an eight-target official-image candidate pipeline.

---

LLMS index: [llms.txt](/llms.txt)

---

> [!NOTE]
> Historical release record (`0.5.0`). Official mirror failover was later added in `0.7.0`, and the `rm` alias was removed in `0.9.0`. Old release downloads are retired; see the [CLI reference](../../../docs/reference/cli/) and [installation guide](/docs/start/installation/) for current usage.

Barn 0.5.0 adds an explicit command to dispose of an entire lab at once, lets operators choose between the global and China Mainland image repositories, and introduces a reproducible build pipeline for normalized official guest images while keeping the Pigsty inventory contract, deployment state format, and embedded catalog revision `2026082903`.

## What changed {#what-changed}

- **`barn purge` (`barn rm` in 0.5.0–0.8.0)** removes the entire Linux deployment—including persistent data disks, deployment keys, state files, and the default SSH config fragment—without interactive confirmation, while preserving the shared image cache and host-global network. Running `purge` when no deployment exists succeeds as a no-op; if residual node directories cannot be verified as Barn-owned, `purge` stops rather than deleting unknown files.
- **Explicit repository selection.** Released binaries default to `https://repo.pigsty.io/barn`, while `--mirror` selects the China Mainland mirror `https://repo.pigsty.cc/barn`. Precedence follows `--repo`, `--mirror`, `BARN_REPO`, and the compiled default, and both official roots verify against the same signed catalog.
- **Strict repository pulls.** Upstream URLs recorded in the image catalog document image provenance and are no longer used as implicit download fallbacks. The selected repository must serve the exact catalog-named `.qcow2` artifact, or the pull fails with instructions to switch repositories or import a local file.
- **Digest-pinned offline image builder.** The source repository includes an offline normalization pipeline for Debian 12/13 and Rocky Linux 8/9 across `amd64` and `arm64`, recording the exact package closure, SBOM, provenance, and `testing` manifest so candidate repositories can be assembled for native boot tests and signing.
- **Toolchain updates.** Source and release pins move to Go 1.27.1, GoReleaser 2.18.0, golangci-lint 2.13.2, and updated Go modules.

## Image normalization pipeline {#image-normalization-pipeline}

The eight-target build matrix prepares normalized guest candidates:
- **Debian 12/13**: installs offline XFS userspace tools for `xfs` data disks.
- **Rocky Linux 8**: provides `/usr/bin/python3`, fixes `sshd_config.d` drop-in inclusion, and cleans legacy network interface state.
- **Rocky Linux 9**: cleans legacy network interface state to match Rocky Linux 8.

Candidate builds remain unsigned and marked `testing` until they pass native boot/readiness smoke tests, two-build reproducibility checks, production signing, and catalog publication (published in `0.6.0`).

## Upgrade and disposal {#upgrade-and-disposal}

Upgrading from 0.4.0 requires no state, inventory, or catalog migration, and existing cached images remain valid. Use `barn purge` only when you want to discard all deployment disks and keys without a prompt; continue to use `barn destroy` when preserving persistent data disks or removing specific nodes.

## Validation {#validation}

Release commit `fc85b65ff6a24b0933b56ae1179be9ada2ba91b1` passed the full local source gate—including module and shell checks, unit and race tests, `go vet`, Staticcheck, deadcode, errcheck, `govulncheck`, four-target cross-builds, image-pipeline and installer tests, dependency-license checks, and GoReleaser 2.18.0 validation—and the tag workflow verified all archives, DEB/RPM packages, SBOMs, Homebrew formula, installer script, release metadata, and SHA-256 checksums.

## Install or upgrade {#install-or-upgrade}

Download the installer and assets from the [Barn 0.5.0 GitHub Release](https://github.com/pgsty/barn/releases/tag/v0.5.0):

```bash
curl -fLO https://github.com/pgsty/barn/releases/download/v0.5.0/install.sh
chmod +x install.sh
BARN_VERSION=0.5.0 ./install.sh
barn version
barn doctor
```

The release also includes the Homebrew formula and `amd64`/`arm64` DEB and RPM packages.
