| by Arround The Web | No comments

How to Downgrade Flatpak App Package in Ubuntu Linux

This tutorial shows how to downgrade and lock (prevent automatic & manual update) Flatpak app packages in Ubuntu and other Linux.

Flatpak is an universal Linux package format that runs in sandbox environment. Many popular applications (e.g., Firefox, GIMP, OBS Studio) provide official Linux packages through Flatpak, and Flathub repository hosts tons of app packages in this format.

I’ve written many tutorials that include how to install a Flatpak package. Here I’m going to show you how to downgrade a Flatpak app, as you know new releases may sometimes have regressions or remove features that you prefer.

NOTE: This tutorial assumes that you have installed some Flatpak app packages! If NOT, then you don’t need to follow it.

And, here are 2 ways to downgrade a Flatpak package. They are either:

  • either Linux command
  • or a graphical tool.

Choose either one that you prefer.

Option 1: Use Linux commands to downgrade Flatpak App

The flatpak command has an update option to update an application or runtime packages. It by default updates the given package to the latest, though user has the choice to tell which code commit to update/downgrade to.

1. List installed Flatpak apps. First, press Ctrl+Alt+T to open up a terminal window. When it opens, run command:

flatpak list --app --columns=name,application,origin,version,installation

The command will list all installed Flatpak apps with given columns (name, ID, version, etc). You may use flatpak list --app --columns=all command instead to list apps with all extra info.

In the output, you need to get the ID of target application (e.g., com.sweethome3.Sweethome3d), and which remote source repository it’s installed from, usually flathub.

2. List history versions of a Flatpak app. Once you got the app ID and which source installed from. Then, you may run the command below to list the publishing history:

flatpak remote-info --log flathub com.sweethome3d.Sweethome3d

In this command you need to replace flathub, and com.sweethome3d.Sweethome3d accordingly.

And, in the output you’ll see the publishing history including the date, subject, and commit information. To downgrade to a certain version, copy the commit code, then do next step.

NOTE: In all the commands below, you need to add --user flag if the app was installed on per-user case. See the command output in step 1 to verify.

3. Downgrade Flatpak package. Finally, run the flatpak update command to install specified version through the commit code and app ID.

sudo flatpak update --commit=xxxxxx com.sweethome3d.Sweethome3d

In command replace the commit code xxxxxx and the ID com.sweethome3d.Sweethome3d with yours. And, note this command need to run with sudo due to permission issue.

As you see in the screenshot, downgrade the app package may also downgrade the run-time, as there may be a run-time update in between the latest and target versions.

When done, re-run the flatpak list command above to identify the app version and enjoy!

4. To lock Flatpak app and prevent from updating automatically or manually, simply use command:

flatpak mask com.sweethome3d.Sweethome3d

Also replace com.sweethome3d.Sweethome3d with your app ID.

(Optional) Unlock and upgrade app to the latest. You may un-lock the app package at anytime with command:

flatpak mask --remove com.sweethome3d.Sweethome3d

After that, run the command below will install the app to the latest version:

flatpak update com.sweethome3d.Sweethome3d

Option 2: Use graphical tool to Download Flatpak app

If you have Linux commands, then there’s a tool can do the job with graphical options.

It’s Warehouse, a free open-source versatile toolbox to install, uninstall, and manage Flatpak apps.

1. First, the app itself is available as Flatpak package. To install it, either use your system package manager or run the command below in terminal:

flatpak install https://dl.flathub.org/repo/appstream/io.github.flattool.Warehouse.flatpakref

2. Once installed, launch the tool either from start menu or GNOME overview depends on your desktop environment.

The app window will list all the installed Flatpak apps. Just click on “⋮” for the target app, and choose “Downgrade” from the drop-down menu.

In next pop-up dialog, choose your desired app version, then click “Downgrade” button (will be available once you chose one from the list). As you can see, there’s also a toggle switch to lock (Disable Updates) app package or not.

That’s all. Enjoy!!

Share Button

Source: UbuntuHandbook

Leave a Reply