Tuesday, 31 March 2020

Rolling back a Flatpak application to a previous version

Today on my main graphics editing PC, I decided to update Gimp from 2.10.16 to 2.10.18. Which should have been OK. Except that it wasn't. I have spent all day dealing with Gimp crashing during saves and trying to work around with ever smaller files to be saved. It did crash last night as well but crashes during saves like that are normally relatively infrequent, and in this case I observed that the system resources were almost completely exhausted, which hasn't been the case at any time today - one save was only half of the file, another was only 3%, and in neither case were the system resources anywhere near excluded.

As the evening approached I have decided enough is enough, let's try to roll back Gimp to the previous version. Well, as it turns out, provided a previous version is available on the server, this is certainly possible.

Flatpak can interrogate a repository for you to see what versions are available by using the following command:

flatpak remote-info --log flathub org.gimp.GIMP

Obviously the last parameter is the path to the repository which for Gimp is the one shown in the example above.

What will come out is a list of commits, for example here is some of the output from a command issued today:

Commit: 62578b6f3b1262ceab9fc5d8a93d1b034cda51636a88bce9de6036ae6c5f038c
   Subject: Release GIMP 2.10.18. (bbbf1b4e)
      Date: 2020-02-25 00:53:47 +0000

    Commit: 57036c515dd653f828b8c6574e4b56fca6c29b6ac04f5e84c328cc6fc5e7987f
   Subject: Release GIMP 2.10.16. (796cb329)
      Date: 2020-02-18 22:43:45 +0000

    Commit: 798d8cd8a6a2ccf1bf21c0f5e9749dd4d97ecd511a3af1922d6fedf6c26e3a7c
   Subject: Release GIMP 2.10.12! (1366fa63)
      Date: 2019-06-13 02:25:52 +0000

In this case I have decided to roll back to 2.10.12 because of being uncertain about whether I had 2.10.12 or 2.10.16 previously installed (there was no release for 2.10.14 for some reason).

To achieve this the following command is required:

flatpak update --commit=798d8cd8a6a2ccf1bf21c0f5e9749dd4d97ecd511a3af1922d6fedf6c26e3a7c 
  org.gimp.GIMP

Note the slightly erroneous command "update" even though you are downgrading in this instance.

One blessing at least is that flatpak, at least on Debian, will not automatically update when you use apt upgrade. So we can use apt to update everything else and flatpak applications will not be affected. I suppose Synaptic or KDE's software manager might one day try to update flatpaks itself - I have no idea if that is the plan the developers have in mind. Every time I see the message there are updates ready I just go to the command window and use apt to install the updates.

However, my other computer has 2.10.18 installed and hasn't been having crashes when I edited large Gimp projects on it so I am not sure what is going on with my graphics computer but I have wasted too much time in the last couple of days to want to continue with 2.10.18 at present. Both computers are fairly up to date with 15 new packages released, most of them being a new Qgis build, so it isn't really obvious right now why the systems appear to behave differently, unless it is this particular file.

Subsequent testing however has shown there is nothing wrong with Gimp and the issue is down to the particular characteristics of this file. Gimp does seem to have internal limits as to the amount of file data it can deal with and it is rare for me to be able to edit a project larger than about 30 GB because they tend to crash on save, probably due to the additional resources needed to compress the file before saving it. There doesn't seem to be any issue with canvas size as such - as one would expect a canvas does not require every pixel to be saved. The software simply needs to save the data in each layer along with its coordinates within the canvas. So I have been able to work with very large canvases of over 10 Gpx without difficulty - as long as they are sparsely populated with graphics layers.

As part of my testing I reinstalled the graphics pc completely which was very easy with only a few applications installed on this special purpose computer, but especially because of being able to reuse the previous home drive which saves a great deal on reinstallation because all of the user settings are kept. The reality is a new installation can be up and running in an hour. I also noted that Debian 10 ships with its own Gimp 2.10 package pre installed (2.10.8) but for some reason this version could not open anything so I have uninstalled it and only use the Flatpak version.