Skip to content
Agentmart
Submit a tool

ssh-os-upgrade

Staged procedure for a major OS version upgrade (Ubuntu LTS-to-LTS, Debian point release) on a Docker-heavy host, with mandatory tmux-wrapping of long-running…

Skill by Nightreaver

IndexedGPL-3.0★ 8
Write a review

Chalk Labs

Need help deploying ssh-os-upgrade?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/nightreaver-ssh-os-upgrade

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Staged procedure for a major OS version upgrade (Ubuntu LTS-to-LTS, Debian point release) on a Docker-heavy host, with mandatory tmux-wrapping of long-running package ops

Use cases: devops

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/ssh-os-upgrade

What's inside

Skill name
ssh-os-upgrade
Description
Staged procedure for a major OS version upgrade (Ubuntu LTS-to-LTS, Debian point release) on a Docker-heavy host, with mandatory tmux-wrapping of long-running package ops
License
GPL-3.0
Instructions
610 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network

Agent Skills spec issues

  • name: missing
  • body: 610 lines (spec recommends under 500)

Files (1)

  • SKILL.md

SKILL.md (first lines)

# SSH OS Upgrade

Choreography for taking a host across a major OS boundary (e.g. Ubuntu
jammy -> noble) without ad-hoc improvisation. Read-only verification
calls are LLM-driven; package mutations and `do-release-upgrade` itself
are operator-driven inside `tmux` so they survive the inevitable
mid-upgrade SSH session loss.

Not for: minor security updates (unattended-upgrades handles those, no
choreography needed); kernel-only updates within the same release
(`apt upgrade && reboot`); container / app upgrades that don't touch
the OS.

## Default-on cheatsheet rejection (since v1.9.0)

`ssh_exec_run` refuses commands that have a native MCP tool -- see
`skills/ssh-exec-run/SKILL.md`. The native-tool flow below avoids
that. Composite scripts (where the script IS the artefact) opt out
via `SSH_EXEC_ALLOW_CHEATSHEET_PATTERNS=true` at the operator level.

This runbook is operator-driven: Section 6 (`do-release-upgrade`),
Sections 4 and 8 (`tmux new -d -s ... 'apt update && apt upgrade ...
| tee'`), and the Section 5 docker-stack-stop loop are all
multi-step bash scripts that the operator runs from their own SSH
session (not via `ssh_exec_run`). Where the runbook does call
native MCP tools (Section 1's snapshot via `ssh-host-snapshot`,
Section 7's `ssh_host_ping` / `ssh_host_info` / `ssh_host_alerts`,
package mutations via `ssh_apt_*`, service mutations via
`ssh_systemctl_*`), use those wrappers directly.

If you DO drive any step from the LLM via `ssh_exec_run`
(e.g. catching up the current release with `apt update && apt upgrade`
inside tmux), the wrapped command is a composite artefact -- the
tmux+apt+dpkg-options+tee bundle MUST run atomically under one
audit correlation id to behave correctly. Set
`SSH_EXEC_ALLOW_CHEATSHEET_PATTERNS=true` for that opt-out, then
prefer `ssh_apt_upgrade` for non-tmux-wrapped catch-ups instead.

## Sequence

1. Pre-flight + snapshot
2. Cleanup orphans
3. Hold app packages
4. Catch up current release (apt upgrade, **tmux-wrapped**)
5. Stop service stacks (internal -> mid -> edge, edge-proxy LAST)
6. `do-release-upgrade` interactively (operator-driven, tmux)
7. Post-reboot verification
8. Remap third-party APT sources + final `apt upgrade`
9. Bring services back up (edge-proxy LAST, again)
10. Post-snapshot + diff vs pre-upgrade snapshot

## 1. Pre-flight + snapshot

- Capture via [ssh-host-snapshot](../ssh-host-snapshot/SKILL.md) with
  label `pre-<target-codename>` (e.g. `pre-noble`). Pull off-box per
  that runbook's Section 4 -- a snapshot only on the host being
  upgraded is the wrong place for it.
- Verify the host's backup system (bareos / restic / borg) is actually
  running and the most recent job completed cleanly.
- Confirm rescue-mode access at the hosting provider (Hetzner Robot,
  Hetzner Cloud console, etc.). That is the Plan B if `do-release-
  upgrade` breaks boot.
- Read `ssh_host_notes` for the host. Per-host quirks (forbidden
  packages, custom port bindings, edge-proxy dependency order) live
  there, not in this generic runbook.

**What the standard snapshot does NOT cover** -- worth knowing because
the OS upgrade can land you in territory the snapshot can't restore by
itself:

- `/boot/grub/grub.cfg` and `/boot/grub/i386-pc/*` -- the snapshot
  captures `/etc/default/grub` and `/etc/grub.d/*` (so `update-grub`
  can regenerate `grub.cfg`), but the generated config itself and the
  grub modules aren't in the tarball.
- The MBR boot code (stage 1 + stage 1.5 in the MBR gap). Not
  filesystem-resident. If grub-install corrupts it, only Hetzner
  rescue + `dd` from a backup recovers.

If you anticipate touching the bootloader (Section 6 GRUB prompts
might force this), capture these extras as a mini-snapshot **before**
the change -- see Section 6's "If you hit GRUB prompts" subsection.

## 2. Cleanup orphans

Stuff that makes the upgrade noisier than it needs to be:

- Exited compose containers from removed services: `docker ps -a
  --filter status=exited` -> `docker rm <name>` once confirmed not
  referenced in any compose file.
- dpkg `rc`-state packages (removed-but-conffiles-remain):
  `dpkg -l | awk '/^rc/ {print $2}'` -> `dpkg --purge <pkg>`. They can
  reactivate dependencies during the upgrade if anything pulls them
  back transitively.
- Failed systemd units: `systemctl --failed` -> resolve or mask before
  proceeding.

Per-host traps (e.g. "do not let apt re-pull apache2") belong in
`ssh_host_notes` -- check before purging.

## 3. Hold app packages

`do-release-upgrade` will move every package available in its target
dist's repos. If you don't want application stacks to move at the same
time, hold them now. From the LLM use the dedicated wrapper:

```python
ssh_apt_mark(host="...", action="hold",
             packages=["postgresql-14", "mariadb-server"])
```

Operator-side equivalent (run from the operator's own root shell):

```bash
apt-mark hold <package> [<package>...]
```

Worth holding:

- Database engines (postgres, mariadb, mongodb) where major-version

From Nightreaver/python-ssh-mcp, GPL-3.0.

More from Nightreaver/python-ssh-mcp

Signals

Stars
8
Forks
0
Open issues
0
Last commit (this folder)
Jun 1, 2026 (5 months ago)
Last release
Jun 2, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
GPL-3.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Nightreaver

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get ssh-os-upgrade running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying ssh-os-upgrade?

CallGet help
Cite this page

ssh-os-upgrade skill. Agent Mart. https://agentmart.dev/skills/nightreaver-ssh-os-upgrade (last updated 2026-10-24)