Three Essentials step + One for more rescue:
- Remove all references to
sid
orunstable
(or whatever you have you want to get rid of) in your/etc/apt/sources.list
(and potentially/etc/apt/sources.list.d/*
) by deleting, replacing, or commenting out. Ensure all those files has what you do want. For example:
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main
deb http://cdn.debian.net/debian/ wheezy main contrib non-free
deb-src http://cdn.debian.net/debian/ wheezy main contrib non-free
- Pin the release you want in
/etc/apt/preferences
. If you are not sure what to put instead ofstable
you can have a look at where the majority of the packages you want to keep come from usingapi list --installed
.
Package: *
Pin: release a=stable
Pin-Priority: 1001
- Finally we have to run the apt update and upgrade process for downgrading all packages.
apt-get update
apt-get upgrade
apt-get dist-upgrade
- If you have issues downgrading a package. Purge it, then reinstall
apt-get purge [your_failing_package]
apt-get install [your_failing_package]
This method isn’t bulletproof but might help rescue some systems.