Skip to content
Agentmart
Submit a tool

ssh-apt-autoremove

Remove orphan APT packages (deps no longer needed)

Skill by Nightreaver

IndexedGPL-3.0★ 8
Write a review

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-apt-autoremove

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

Remove orphan APT packages (deps no longer needed)

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-apt-autoremove

What's inside

Skill name
ssh-apt-autoremove
Description
Remove orphan APT packages (deps no longer needed)
License
GPL-3.0
Instructions
80 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • name: missing

Files (1)

  • SKILL.md

SKILL.md (first lines)

# `ssh_apt_autoremove`

**Tier:** dangerous | **Group:** `pkg` | **Tags:** `{dangerous, group:pkg}`

Runs `apt-get -y autoremove` on the remote host. Requires root: use a
sudoers-enabled SSH account, or use `ssh_sudo_exec`. Hidden unless
`ALLOW_DANGEROUS_TOOLS=true`.

Removes packages that were installed automatically as dependencies for
some other package, where nothing currently installed still requires
them. Typically follows a manual `ssh_apt_remove` to clean up the deps
that came along with the package you just removed.

## Inputs

| name | type | required | default | notes |
|---|---|---|---|---|
| `host` | str | yes | -- | Alias |
| `timeout` | int | no | None | Per-call command timeout |

## Returns

```json
{
  "host": "web01",
  "action": "autoremove",
  "packages": [],
  "exit_code": 0,
  "stdout": "Reading package lists...\n...\nThe following packages will be REMOVED:\n  libxxx libyyy\n...",
  "stderr": "",
  "duration_ms": 1842,
  "stdout_truncated": false,
  "output_warnings": []
}
```

`packages` is always `[]` -- autoremove takes no package argument. The
list of packages apt actually removed is in `stdout` (under "The
following packages will be REMOVED:").

## When to call it

- After `ssh_apt_remove` to clean up orphan dependencies.
- Periodic cleanup of a server that has been through many install /
  remove cycles.

## When NOT to call it

- You are not certain whether automatic-marker tracking is intact --
  packages incorrectly marked automatic can disappear here. Inspect
  `stdout` after the call to see what was removed.
- You want to remove a specific package -- use `ssh_apt_remove`.

## Examples

```python
# Routine cleanup
ssh_apt_autoremove(host="web01")
```

## Validation

No user-supplied input beyond `host` and `timeout`. Argv is fixed
(`["apt-get", "-y", "autoremove"]`) so there is no injection surface.

## Common failures

- `exit_code=0` and stdout shows "0 to remove" -- nothing was orphaned;
  no-op.
- An autoremove sweeps a package you wanted to keep -- restore with
  `ssh_apt_install(host=..., packages=[that_pkg])`, then optionally
  `ssh_apt_mark(action="hold", packages=[that_pkg])`.

## Related

- `ssh_apt_remove` -- the call that usually precedes this one
- `ssh_apt_mark` -- pin a package so a future autoremove leaves it
- `ssh_apt_list` -- inspect installed packages before / after

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

Cite this page

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