Skip to content

Instantly share code, notes, and snippets.

@aerodomigue
Created August 17, 2025 11:15
Show Gist options
  • Select an option

  • Save aerodomigue/0320ec3dffbc60caeaee8a6fc83cb470 to your computer and use it in GitHub Desktop.

Select an option

Save aerodomigue/0320ec3dffbc60caeaee8a6fc83cb470 to your computer and use it in GitHub Desktop.
Upgrade LXC Debian 12 to 13 (copy/paste solution)
#!/bin/bash
# Update source from bookworm to trixie
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
apt-get update
# Upgrade to trixie
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" dist-upgrade -y
# Disable services that break in LXC / containers (harmless if not present)
systemctl disable --now systemd-networkd-wait-online.service || true
systemctl disable --now systemd-networkd.service || true
systemctl disable --now ifupdown-wait-online || true
# Install ifupdown2 (better networking stack for LXC/VMs)
apt-get install -y ifupdown2
# Cleanup
apt-get autoremove --purge -y
apt-get clean
reboot
@Blener

Blener commented Aug 27, 2026

Copy link
Copy Markdown

Thank you for the script. I added a check before the upgrade because I have some containers that are not debian, it's in here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment