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
@aerodomigue
Copy link
Author

aerodomigue commented Aug 17, 2025

Execute the Script Directly

You can run this script with a single line using either curl or wget.


Using Curl

This command downloads the script and pipes it directly to bash for execution. The -fsSL options make the command silent and follow redirects.

bash -c "$(curl -fsSL https://gist.githubusercontent.com/aerodomigue/0320ec3dffbc60caeaee8a6fc83cb470/raw/4b7f65f5adbf400d6bb9607c396fc79dfc7fe4c2/upgrade_debian_12_to_13.sh)"

Using Wget

This command downloads the script and pipes it to bash for execution. The -O - option sends the content to standard output.

wget -O - https://gist.githubusercontent.com/aerodomigue/0320ec3dffbc60caeaee8a6fc83cb470/raw/4b7f65f5adbf400d6bb9607c396fc79dfc7fe4c2/upgrade_debian_12_to_13.sh | bash

@calvinthefreak
Copy link

Thanks budy. Quite nice to have this, could've written that my self, but heh, lazyness is the key :D

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