Skip to content

Instantly share code, notes, and snippets.

@cgomesu
Created February 2, 2023 19:14
Downgrading packages in APT-based distros

How to downgrade a package in APT-based distros

  1. Check latest package upgrades in /var/log/dpkg.log:

    cat /var/log/dpkg.log | grep -i upgrade

    which should output something like this:

    2023-02-02 08:48:31 upgrade docker-ce-cli:amd64 5:20.10.23~3-0~debian-bullseye 5:23.0.0-1~debian.11~bullseye
    2023-02-02 08:48:32 upgrade docker-ce:amd64 5:20.10.23~3-0~debian-bullseye 5:23.0.0-1~debian.11~bullseye
    2023-02-02 08:48:34 upgrade docker-ce-rootless-extras:amd64 5:20.10.23~3-0~debian-bullseye 5:23.0.0-1~debian.11~bullseye
  2. Then, to downgrade, say, the docker-ce-cli package back to its previous version, run apt install and specify the older version:

    sudo apt install docker-ce-cli:amd64=5:20.10.23~3-0~debian-bullseye

    which should indicate that you're attempting to revert the package. Follow instructions and that's it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment