OS updates
Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.
The OS Updates section of a server (/servers/:id/os-updates) keeps the box’s
operating system patched. It lists pending apt package updates, flags security
fixes, lets you apply them (all, security-only, or one at a time) with live output,
sets an unattended-upgrade policy, and shows a history of past update runs. It’s
available on all plans.
Apply updates, step by step
Section titled “Apply updates, step by step”- Click Check for updates to refresh the package index (
apt-get update) so the pending list is current. The summary shows pending updates, security fixes, the download size, and when the box was last checked. - Review the Pending updates list. Each row shows the package name, its current → candidate version, and a red Security pill for security-pocket updates.
- Choose how much to apply:
- Update on a single row — upgrade just that package.
- Update security only — upgrade only the packages flagged as security fixes.
- Update all — a full
dist-upgrade; you’ll confirm first, since it can touch core libraries and may need a reboot.
- Output streams live into a log panel as
aptruns, ending with the exit code. The list refreshes itself when the run finishes.
What else you can do
Section titled “What else you can do”-
Reboot when required — after a kernel or core-library update, a Reboot required banner appears. Click Reboot now (with a confirm) to restart the box; the agent reconnects automatically once it’s back.
-
Automatic updates and reboot schedules live in Settings. This page shows a one-line summary (the policy, the last unattended run, and an Apply N security update(s) now shortcut) with a link to Settings → Updates & reboots, the one place to change:
- Automatic updates — Off, Security only or All (
unattended-upgradeson Debian/Ubuntu,dnf-automaticon EL). Saves the moment you change it. - Auto-reboot when required + reboot time (Debian/Ubuntu) — when a nightly automatic update needs a reboot, reboot at that hour.
- Maintenance reboot window — a weekly (or daily) day + hour at which a box-side
timer reboots only if a reboot is pending. Works on every supported distro.
Job:
system.reboot-window {action: set|off|status, day?: daily|mon|…|sun, at?: "HH:MM"}; an agent too old for it answers with exit127. - Which reboot wins: neither overrides the other. Both reboot only while a reboot is pending, so whichever fires first reboots and the other then finds nothing to do. With both on, Settings warns and offers Use window only (turns the auto-reboot off).
- Agent updates — the agent version and its auto-update policy (
pinned,manual,security,auto, or inherit the workspace default).
In MZPanel Local (no Settings page) the automatic-updates card stays on this page.
- Automatic updates — Off, Security only or All (
-
Live kernel patching — under Live kernel patching, paste your own Ubuntu Pro token to enable Canonical Livepatch, applying high/critical kernel CVE fixes to the running kernel without a reboot. The token is free for up to 5 machines and is never echoed back. The card is shown on Ubuntu servers only; on Debian, AlmaLinux and Rocky it is hidden.
-
Other distros — on AlmaLinux/Rocky the section words the package manager as
dnf, the automatic-updates engine asdnf-automaticand a pending reboot as a kernel or glibc update. -
Recent update runs — the History list shows past transactions (manual and unattended), each expandable to the exact command, duration, and per-package version changes.
How it works
Section titled “How it works”Every action dispatches an updates.* (or system.reboot) job to the server’s agent,
which runs it natively — no shell-out to a mz process:
| Action | Job | Agent runs |
|---|---|---|
| Pending list + counts | updates.list | updates --json (served from the agent’s cache) |
| Check for updates | updates.refresh | apt-get update, streamed |
| Update one package | updates.apply | apt-get install --only-upgrade <pkg> |
| Update security only | updates.apply | derives -security packages, upgrades those |
| Update all | updates.apply | apt-get dist-upgrade -y, streamed |
| Auto-update policy | updates.auto | rewrites 20auto-upgrades + an MZPanel drop-in |
| History | updates.history | parses /var/log/apt/history.log (+ rotated .gz) |
| Live patching | livepatch.* | the Ubuntu Pro pro CLI |
| Reboot | system.reboot | schedules a detached reboot |
The pending list is read from the agent’s pushed inventory cache rather than a live
scan — the apt scan is slow (~4s), so it rides the 5-minute batch and refreshes after
any apply/refresh/policy change. State lives on the box: the auto-update policy is a
config fragment at /etc/apt/apt.conf.d/52unattended-upgrades-mz, and history comes
from apt’s own logs.
CLI & automation
Section titled “CLI & automation”Every action here maps to an mz updates command on the box — the same engine the
dashboard drives:
mz updates --json # pending packages + counts + reboot flagmz updates refresh # apt-get update, streams outputmz updates apply --security # upgrade only security-pocket packagesmz updates apply --all # full dist-upgrade, streams outputmz updates auto security --reboot-time 04:00 --auto-reboot onmz updates history # recent apt transactions (JSON)mz system reboot-window set sun 04:00 --json # reboot Sundays 04:00 if pendingApply a specific set with mz updates apply --only nginx,openssl. Pass --json for
machine-readable reads. See The mz CLI and the
command catalog.
Automate it (MCP / REST)
Section titled “Automate it (MCP / REST)”| Goal | MCP tool | Job kind |
|---|---|---|
| Pending packages + reboot flag | servers_inventory with kind updates | updates.list |
| Refresh / apply | jobs_create | updates.refresh, updates.apply |
| Auto-update policy | jobs_create | updates.auto |
| History | jobs_create | updates.history |
| Reboot window | jobs_create | system.reboot-window |
| Reboot now | jobs_create | system.reboot |
updates.apply needs a full-level token; system.reboot also needs the
system:admin scope. Call jobs_schema for the exact body of each kind.
Gotchas & troubleshooting
Section titled “Gotchas & troubleshooting”- Offline shows the last-known state, not sample data. When the agent is offline the page shows what was last cached from the box (or an “Agent offline” state if nothing was cached yet). Bring the agent online for a fresh scan and to apply anything.
- Download size can read 0. The live
aptscan doesn’t carry a per-package byte size, so individual rows omit it and the “to download” total may be small or zero even with updates pending — it’s not an error. - “Update all” has no undo. It’s a full
dist-upgrade— confirm the modal warning and back up critical servers first. - Reboot goes down immediately. Reboot now schedules a detached reboot and the box drops offline; the Reboot required banner clears on the next update read after the agent reconnects.
- Live patching needs Ubuntu Pro. If
ubuntu-pro-clientisn’t installed the card shows it as unavailable; enabling requires your own Pro token (ubuntu.com/pro). Not every kernel update is livepatchable — some still need a reboot. - History security counts can under-report old runs. Security tagging cross-checks the current apt security lists, so a run whose security version has since been superseded may under-count; recent runs are accurate.
Related
Section titled “Related”- Cron jobs — scheduled tasks on the server.
- Backups — snapshot before a major upgrade.
- The mz CLI — driving the box from the command line.