Temporarily force packages from stretch-backports to be installed even if same version is already installed from testing
cat <<EOF | sudo tee /etc/apt/preferences.d/pinning
Package: erlang*
Pin: release a=stretch-backports
Pin-Priority: 1001
Package: ejabberd*
Pin: release a=stretch-backports
Pin-Priority: 1001
Package: erlang*
Pin: release a=stable
Pin-Priority: 1001
EOF
Get all packages which have been installed from testing repo and ask for install. As we previously pinned priority > 1000, apt
will DOWNGRADE packages to the version from stretch-backports
:
TESTING=$(apt list --installed | grep "/testing" | cut -d '/' -f1)
apt update
apt install $TESTING