I. Preparations Before Upgrade
-
Backup Important Data Before upgrading, be sure to back up all important files, especially
/home
and configuration files. Also, export a list of installed software usingdpkg --get-selections
for easier restoration. Refer to Debian's official recommendation: Back up removable media and disconnect it. -
Confirm Supported Environment
- Non-physical servers, especially VPS using OpenVZ 6 or certain LXC architectures, may not support upgrading due to the lack of an independent kernel.
- If your system uses root filesystem encryption, ensure
cryptsetup-initramfs
is marked as manual to prevent accidental removal.
-
Check Disk Space At least 5 GB of free space is required to prevent system anomalies caused by insufficient space during the upgrade.
-
Recommended Test Upgrade Process (Optional) You can simulate the upgrade in a virtual environment using a rescue image and QEMU. Verify that everything is correct before proceeding with the official upgrade.
II. System Cleanup and Updates Before Upgrade
bashsudo -i # Switch to root
apt update
apt upgrade -y
apt full-upgrade -y
apt autoclean
apt autoremove -y
If the kernel has been updated, it is recommended to reboot: reboot
.
III. Update APT Sources to Trixie
Replace bookworm
with trixie
:
bashsed -i 's/bookworm/trixie/g' /etc/apt/sources.list
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/*.list
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/*.sources
If your system supports the new DEB822 format, you can delete the old sources.list
, keeping /etc/apt/sources.list.d/debian.sources
, or use the command to convert: