6

I am currently running Debian "testing", and I have just upgraded Gimp from version 2.10.8-2 to version 2.10.8-2+b1. Sadly, it does not work for me. I can't open any image, not even create a new blank image, as it crashes every time.

Hoping that the repository would have at least a few versions of the package, I tried to downgrade with

apt install gimp=2.10.8-2

and also

apt-get install gimp=2.10.8-2

But both failed with Version '2.10.8-2' for 'gimp' was not found.

Is there a reliable way to downgrade any package in Debian? Perhaps some sort of "rollback" after an unsatisfactory upgrade?

I considered adding the stable repository and forcing the downgrade at times, possibly pinning back the offending packages. But I would like a less drastic solution first, considering that this might require too many dependencies to be downgraded. Might cause more problems than it solves.

giusti
  • 1,737
  • 2
  • 16
  • 31
  • By the way, I tried to report a bug, but reportbug is crashing with an uncaught socket.timeout exception. – giusti Sep 10 '19 at 02:30
  • 1
    Do you have the older version in /var/cache/apt/archives? – muru Sep 10 '19 at 02:42
  • Possible duplicate of https://superuser.com/questions/459480/downgrading-packages-in-debian – ajgringo619 Sep 10 '19 at 02:43
  • Rather than going through the trouble of downgrading it, you're better off building it from source. You can get the source code here: https://download.gimp.org/mirror/pub/gimp/v2.10/ – Nasir Riley Sep 10 '19 at 02:45
  • @muru Looks like I have 6 versions of that package. I could install manually! Is there any trick to help with potential dependencies? – giusti Sep 10 '19 at 02:48
  • @NasirRiley I can download and build it, but I don't know how to install it like APT does. The few times I build something from scratch I just leave it in /opt and call from the terminal. – giusti Sep 10 '19 at 02:54
  • If it works then what's the problem? – Nasir Riley Sep 10 '19 at 03:08
  • If the older versions of the packages are still accessible via apt, you could try aptitude and figure out working configuration with correct dependencies. – dirkt Sep 10 '19 at 06:17

1 Answers1

8

The apt tools don’t support rolling back, so there’s no straightforward way to undo an upgrade. You need to identify the packages you want to downgrade, and find the corresponding binaries to give to either apt or dpkg. There are a number of approaches you can use.

The most general one is to use snapshot.debian.org. This contains a copy of every single package uploaded to the Debian archives, and also provides snapshot repositories with a coherent set of packages for a given timestamp. In your case, you’d look for the appropriate version of the gimp source package, then add the corresponding repository to your sources (see the main page for instructions).

Another approach which works in this particular instance, and which you’ve considered, is to add Debian 10 to your repositories, since the version of the gimp package you want to downgrade to is available there. Currently this won’t result in any downgrading apart from the gimp packages; you’ll only end up with libopenexr23 alongside libopenexr24.

Finally, since you still have the older package in the apt archives (/var/cache/apt/archives), you can install it from there, either using dpkg -i, or by turning your cache into a repository:

  • copy all the packages somewhere safe

  • create the Packages file:

    dpkg-scanpackages . > Packages
    

    (in the directory you copied all the packages to; you’ll need dpkg-dev for dpkg-scanpackages)

  • compress the Packages file:

    gzip < Packages > Packages.gz
    

    (this keeps both files)

  • create the Release file:

    apt-ftparchive -o "APT::FTPArchive::Release::Origin=cache-repository" release . > Release
    

    (you’ll need apt-utils for apt-ftparchive)

  • sign it:

     gpg --yes --sign --armor --clearsign --output InRelease Release
    

Then you can add a deb file:/path/to/... entry to your repositories and install packages from there. (You can skip the signing step if you tell apt to assume the repository is trusted.)

Stephen Kitt
  • 434,908
  • This worked perfectly for downgrading terminator to the last version 2.1.2-2, since 2.1.3-1 does not show the right-click context menu. – hochl Jul 02 '23 at 14:06