Skip to main content
Community Scripts logo
Skip to Content
Tools & Add-onsPVE Tools

PVE LXC Updater

Update the operating system packages of all LXC containers on a node in one interactive run.

update-lxcs.sh walks through every LXC container on the node and runs the distribution's package upgrade inside it. It does not update the application in the container; for that use PVE LXC Apps Update. For a scheduled, non-interactive version see PVE Cron LXC Updater.

Website entry: update-lxcs. Source: tools/pve/update-lxcs.sh.

Run

In the Proxmox VE host shell, as root:

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/update-lxcs.sh)"

Prompts

DialogChoicesEffect
"This Will Update LXC Containers. Proceed?"Yes / NoNo ends the script.
"Do you want to skip containers that are not currently running?"Yes / NoYes leaves stopped containers alone. No starts each stopped container, updates it and shuts it down again.
"Select containers to skip from updates:" (checklist)All containers from pct listTicked containers are skipped.

What it runs

The command depends on the container's ostype:

ostypeCommand inside the container
alpineapk -U upgrade
archlinuxpacman -Syyu --noconfirm
fedora, rocky, centos, almadnf -y update && dnf -y upgrade
ubuntu, debian, devuanapt-get update, apt-get -yq dist-upgrade, apt-get -yq autoremove, apt-get -yq autoclean, then removes /usr/lib/python3.*/EXTERNALLY-MANAGED
opensusezypper ref && zypper --non-interactive dup

Other OS types are passed over without a command. Templates are never started.

For Ubuntu, Debian and Fedora containers the script prints how full /boot is before updating. After the update of a running container it:

  • records the container if /var/run/reboot-required exists and lists those containers at the end,
  • runs /usr/local/bin/patchmon-agent report if that file exists in the container.

Containers whose update command failed, or that could not be started, are listed at the end and the script exits with 1. For Ubuntu, Debian and Devuan containers the command line always ends with a successful rm, so a failed apt-get run is not detected there.

What it changes

Only packages inside the containers. Nothing is written on the host, and the script does not reboot containers.

Environment variables

VariableDefaultPurpose
COMMUNITY_SCRIPTS_CORE_URLhttps://raw.githubusercontent.com/community-scripts/core/mainBase URL the script loads api/api.func from.

Limits

  • There is no undo. Take a snapshot or backup first if a container matters.
  • A stopped container gets 5 seconds after pct start before the update command runs.
  • Removing EXTERNALLY-MANAGED lets pip install system-wide in Debian and Ubuntu containers again; the script does this on every run.