Skip to content

Instantly share code, notes, and snippets.

@asishrs
Created January 31, 2026 19:06
Show Gist options
  • Select an option

  • Save asishrs/59da3ac791343884ffdd5863cf1fa404 to your computer and use it in GitHub Desktop.

Select an option

Save asishrs/59da3ac791343884ffdd5863cf1fa404 to your computer and use it in GitHub Desktop.
Proxmox 8.4 to 9 update
#!/usr/bin/env bash
set -euo pipefail
echo "=== Proxmox VE 8 -> 9 helper script ==="
echo "Node: $(hostname)"
echo
# 0. Basic sanity: must be root
if [[ "$EUID" -ne 0 ]]; then
echo "ERROR: Please run as root."
exit 1
fi
# 1. Show cluster status
echo "=== Cluster status (pvecm status) ==="
pvecm status || echo "WARNING: pvecm status failed (standalone node?)"
echo
# 2. Update current PVE 8 packages
echo "=== Step 1: Update PVE 8 packages ==="
apt update
apt dist-upgrade -y
echo
# 3. First pve8to9 run
echo "=== Step 2: Run pve8to9 --full (pre-check) ==="
pve8to9 --full || true
echo
echo "Review the output above."
echo "This script will now try to auto-fix the common issues you had (systemd-boot + microcode)."
echo
# 4. Fix systemd-boot meta-package if present
echo "=== Step 3: Check & remove systemd-boot meta-package if installed ==="
if dpkg -l | grep -q '^ii systemd-boot '; then
echo "systemd-boot meta-package found, purging..."
apt purge -y systemd-boot
update-grub || true
else
echo "No systemd-boot meta-package installed, skipping."
fi
echo
# 5. Enable non-free-firmware and install Intel microcode (optional, safe)
echo "=== Step 4: Enable non-free & install intel-microcode (Intel CPUs only) ==="
if lscpu | grep -qi 'GenuineIntel'; then
echo "Intel CPU detected, enabling non-free & installing intel-microcode..."
sed -i 's/main contrib/main contrib non-free non-free-firmware/g' /etc/apt/sources.list
apt update
if ! apt install -y intel-microcode; then
echo "WARNING: intel-microcode install failed; you can investigate later."
fi
else
echo "Non-Intel CPU detected, skipping intel-microcode."
fi
echo
# 6. Re-run pve8to9 to confirm issues are gone
echo "=== Step 5: Re-run pve8to9 --full after fixes ==="
pve8to9 --full || true
echo
echo "If there are still FAIL lines above, fix them manually before continuing!"
read -p "Press Enter to continue to repo switch & dist-upgrade, or Ctrl+C to abort..."
# 7. Switch Debian & PVE repos from bookworm/8 to trixie/9
echo "=== Step 6: Switch Debian & PVE repos to 9.x/Trixie ==="
# Debian main sources
if grep -q 'bookworm' /etc/apt/sources.list; then
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
fi
# Common Proxmox enterprise/no-subscription files (adjust if yours differ)
for f in /etc/apt/sources.list.d/*.list; do
[ -e "$f" ] || continue
if grep -q 'bookworm' "$f"; then
sed -i 's/bookworm/trixie/g' "$f"
fi
if grep -q 'pve-enterprise' "$f"; then
sed -i 's/pve-enterprise/pve-enterprise/g' "$f"
fi
done
echo "Repositories switched where 'bookworm' was found."
echo
# 8. Final upgrade to PVE 9
echo "=== Step 7: Final apt update & dist-upgrade to PVE 9 ==="
apt update
apt dist-upgrade -y
echo
echo "=== Step 8: Final pve8to9 check ==="
pve8to9 --full || true
echo
echo "If no FAIL lines remain, you can now reboot into Proxmox VE 9."
read -p "Press Enter to reboot now, or Ctrl+C to skip reboot..."
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment