feat: graceful fallback for apt-get update failures (#12386)

Add apt_update_safe() function that warns instead of aborting when apt-get update fails (e.g. enterprise repo 401 Unauthorized). Shows a helpful hint about disabling the enterprise repo when no subscription is active. Replaces direct  apt-get update calls in build.func and install.func.
This commit is contained in:
CanbiZ (MickLesk)
2026-02-27 14:39:39 +01:00
committed by GitHub
parent 9e9dfd6947
commit a2dc3f44d3
3 changed files with 50 additions and 2 deletions

View File

@@ -4927,7 +4927,8 @@ create_lxc_container() {
case "${_ans,,}" in
y | yes)
msg_info "Upgrading Proxmox LXC stack (pve-container, lxc-pve)"
if $STD apt-get update && $STD apt-get install -y --only-upgrade pve-container lxc-pve; then
apt_update_safe
if $STD apt-get install -y --only-upgrade pve-container lxc-pve; then
msg_ok "LXC stack upgraded."
if [[ "$do_retry" == "yes" ]]; then
msg_info "Retrying container creation after upgrade"