Skip to main content

Debian LXC Upgrade From 12 to 13

Upgrading an LXC Container from Debian 12 to 13 is fairly straightforward.

Change the Sources to Trixie

This will replace the Bookworm Sources to the new Debian 13 Trixie sources in the Sources list. Add SUDO if not running as root.

sed -i 's/bookworm/trixie/g' /etc/apt/sources.list

Update Packages

Updating the available packages from the Trixie libraries will allow the container to know what is available.

apt update

Distribution Update

After the packages list has been created the Distribution can be upgraded.

apt dist-upgrade

This might take a bit of time and may ask some questions about files that have been customized. 

If unsure hit enter to go with then default.

When it is complete is a good time to reboot.

Modernize the Sources

After the upgrade Sources should be Modernized so the sources are formatted in the new style format.

apt modernize-sources

Clean up after the upgrade

Auto removing old packages is a good idea to be done after any upgrade and clean the sources

apt-get autoremove --purge -y
apt-get clean

Check Linux Version

This will produce easy to read information on the container

hostnamectl

Or, check the os-release file 

cat /etc/os-release

Docker Consideration

If the container runs Docker, this too should have the sources updated and an update run to ensure full compatibility.

Replace Bookwork Sources with Trixie Sources

sed -i 's/Suites: bookworm/Suites: trixie/' /etc/apt/sources.list.d/docker.sources

Update the Package List

apt update

Upgrade the Packages

apt upgrade