I want to switch from Debian Buster to Debian Bullseye. After doing this, can I return all Bullseye packages to Buster? (Unupgrade packages)
2 Answers
Stephen Kitt is correct. It's not supported. But if you have nothing to lose, this is how you'd do it:
Set your sources to buster:
sudo sed -i \ -e 's/bullseye/buster/g' \ -e 's/unstable/buster/g' \ -e 's/stable/buster/g' \ -e 's/testing/buster/g' \ -e 's/sid/buster/g' \ /etc/apt/sources.list \ /etc/apt/sources.list.d/*Tell apt to set
busteras your preferred release and set a priority that allows downgrades by creating/etc/apt/preferences.d/busterwith this:Package: * Pin: release n=buster Pin-Priority: 1001Say a little prayer
Perform the "upgrade":
# Upgrade sudo apt update sudo apt upgrade sudo apt dist-upgrade sudo apt --fix-broken install sudo apt autoremoveCycle through
upgrade,dist-upgrade,--fix-broken installandautoremoveover and over until apt finishes successfully everywhere.Celebrate because if you get here, then things probably worked out ok.
Remove
/etc/apt/preferences.d/busterso it doesn't affect you in the future.
-
I followed your procedure and it worked pretty well - I had to
apt removesome stuff manually because they were conflicting when doingapt upgrade, anddist-upgradefailed the first time but in the end everything looks fine. Just a warning: do not try this through SSH because thedist-ugpradejust kicked me during the process and I had to restore a snapshot.– HoltCommented Oct 27, 2022 at 8:12
Technically, you can, but downgrades aren’t supported and we don’t test them. The downgrade might work fine, but it might not, and Bullseye is now sufficiently far ahead of Buster that I wouldn’t try it.