Skip to content

Instantly share code, notes, and snippets.

@sepastian
Last active March 16, 2024 12:19
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sepastian/f5e0f37d84017e9930653699c4a7ecdb to your computer and use it in GitHub Desktop.
Save sepastian/f5e0f37d84017e9930653699c4a7ecdb to your computer and use it in GitHub Desktop.
Downgrade Debian

Debian System Downgrade

Is it supported? Short answer: No, it isn't supported.

From https://wiki.debian.org/SystemDowngrade.

It's still possible but:

WARNING: BACKUP YOUR SYSTEM FIRST.

Update /etc/apt/sources.list

Replacing all testing with stable.

# cat /etc/apt/sources.list
deb http://deb.debian.org/debian stable main contrib non-free
deb-src http://deb.debian.org/debian stable main contrib non-free

deb http://deb.debian.org/debian-security/ stable/updates main contrib non-free
deb-src http://deb.debian.org/debian-security/ stable/updates main contrib non-free

deb http://deb.debian.org/debian stable-updates main contrib non-free
deb-src http://deb.debian.org/debian stable-updates main contrib non-free

Running apt update && apt dist-upgrade now wouldn't change any packages, because packages from testing have newer version numbers than the ones from stable.

To circumvent this, create /etc/apt/preferences.d/downgrade with the following content. This file can be deleted after the update has completed.

# $ cat /etc/apt/preferences.d/downgrade
Package: *
Pin: release a=stable
Pin-Priority: 1001

Now, Debian will install packages from stable.

WARNING: BACKUP YOUR SYSTEM BEFORE THE NEXT STEP.

sudo apt update
sudo apt dist-upgrade

Cleanup.

rm /etc/apt/preferences.d/downgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment