Skip to content

Instantly share code, notes, and snippets.

@ldvc
Last active February 5, 2020 10:01
Show Gist options
  • Save ldvc/96e7c2835ea60ab8f5b87ffbbb090281 to your computer and use it in GitHub Desktop.
Save ldvc/96e7c2835ea60ab8f5b87ffbbb090281 to your computer and use it in GitHub Desktop.
Use APT pinning in order to force package downgrade

Reinstall packages (testing → backports)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment