Created
August 17, 2025 11:15
-
-
Save aerodomigue/0320ec3dffbc60caeaee8a6fc83cb470 to your computer and use it in GitHub Desktop.
Upgrade LXC Debian 12 to 13 (copy/paste solution)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
Author
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
Execute the Script Directly
You can run this script with a single line using either
curlorwget.Using Curl
This command downloads the script and pipes it directly to
bashfor execution. The-fsSLoptions 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
bashfor 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