fix(lxc-stack): use host upgrade instead of dist-upgrade in recovery flow

This commit is contained in:
CanbiZ (MickLesk)
2026-04-23 17:00:07 +02:00
parent f51b3ae221
commit 2e97eb8aae

View File

@@ -5449,21 +5449,21 @@ create_lxc_container() {
msg_warn "An update for the Proxmox LXC stack is available"
echo " pve-container: installed=${_pvec_i:-n/a} candidate=${_pvec_c:-n/a}"
echo " lxc-pve : installed=${_lxcp_i:-n/a} candidate=${_lxcp_c:-n/a}"
echo " note : option 1 runs host apt update + apt dist-upgrade"
echo " note : option 1 runs host apt update + apt upgrade"
echo
# Offer older OS version fallback when template version might be too new for LXC stack
local _has_fallback_option=false
if [[ "$do_retry" == "yes" ]] && has_previous_os_version_template; then
_has_fallback_option=true
echo " [1] Run host dist-upgrade now (recommended)"
echo " [1] Run host upgrade now (recommended)"
echo " [2] Use an older ${PCT_OSTYPE} template instead (may not work with all scripts)"
echo " [3] Ignore"
echo " [4] Cancel"
echo
read -rp "Select option [1/2/3/4]: " _ans </dev/tty
else
echo " [1] Run host dist-upgrade now (recommended)"
echo " [1] Run host upgrade now (recommended)"
echo " [2] Ignore"
echo " [3] Cancel"
echo
@@ -5508,16 +5508,16 @@ create_lxc_container() {
case "${_ans,,}" in
y | yes)
msg_info "Running host dist-upgrade for LXC stack compatibility"
msg_info "Running host upgrade for LXC stack compatibility"
apt_update_safe
if $STD apt-get dist-upgrade -y; then
if $STD apt-get upgrade -y; then
msg_ok "LXC stack upgraded."
# Verify pct binary still works after upgrade (partial upgrades can break Perl modules)
if ! pct list &>/dev/null; then
msg_error "LXC stack upgrade caused PVE tool breakage (likely Perl module incompatibility)."
msg_custom "⚠️" "${YW}" "A partial package upgrade has left the PVE stack in an inconsistent state."
msg_custom "🔧" "${YW}" "Please run the following on the Proxmox host, then retry:"
echo -e "${TAB} apt update && apt dist-upgrade -y"
echo -e "${TAB} apt update && apt upgrade -y"
echo -e "${TAB} reboot"
return 3
fi