Uninstalling the Agent
This guide covers fully removing the PatchCTL agent from a Linux server.
What Uninstall Does
- Stops and disables the
patchctlsystemd service - Removes agent binaries and runtime files
- Removes PatchCTL config by default (
/etc/patchctl/config.json) - Optionally keeps config or logs when needed
- Attempts a best-effort API decommission call before local cleanup
Recommended Method
Use the local lifecycle script that install puts on each node:
From repository checkout
sudo /opt/patchctl/install.sh --uninstall --yes
Useful Flags
- Keep config:
sudo /opt/patchctl/install.sh --uninstall --yes --keep-config - Keep logs:
sudo /opt/patchctl/install.sh --uninstall --yes --keep-logs - Preview actions only:
sudo /opt/patchctl/install.sh --uninstall --dry-run - Skip API decommission call:
sudo /opt/patchctl/install.sh --uninstall --yes --skip-api
Manual Removal (Fallback)
If you cannot use the uninstall script:
Manual fallback commands
sudo systemctl stop patchctl.service || true
sudo systemctl disable patchctl.service || true
sudo rm -f /etc/systemd/system/patchctl.service
sudo systemctl daemon-reload
sudo rm -f /opt/patchctl/bin/patchctl-agent
sudo rm -rf /opt/patchctl
sudo rm -f /usr/local/bin/patchctl-agent
sudo rm -rf /usr/local/lib/patchctl
sudo rm -f /etc/patchctl/config.json /etc/patchctl/config.json.bak
sudo rmdir /etc/patchctl 2>/dev/null || true
Remove the Server from Dashboard
Uninstalling from the host and removing from dashboard are separate actions.
After uninstalling locally, remove the server in the dashboard:
- Go to Servers
- Select the server
- Choose Remove Server
Notes
- Removing a server in dashboard does not uninstall software from the host.
- Node quota release policy:
- If a server is removed within the provisional window (first 24 hours) and never ran patch actions, the slot releases immediately.
- Otherwise, a temporary quota hold can apply: until billing-period end for paid plans, or 30 days for free plan.
- Historical records may still exist based on retention policy.
Reinstall Later
If needed, reinstall using the installation guide.