Downgrade Flatpak packages with ease on Linux

Downgrade Flatpaks Packages Easily On Linux!

The problem with being up-to-date with all the software packages is that you have to encounter bugs. Sometimes the developers do not test their applications enough and push for updates everywhere and the end user has to suffer (note that FOSS applications do not come with a warranty). And sometimes when everything is perfect on the developer’s end, you still might encounter bugs on your end due to unexpected reasons.

Also read: How to set up and enable Flatpaks on Linux

In this tutorial, I will show you how can you downgrade any Flatpak application on any Linux distribution as the flatpak command is very different from any distribution’s default package manager such as apt, pacman, or dnf.

Downgrading Flatpaks

Let’s now now look at the steps of downgrading flatpaks.

List the application ID

To downgrade any package, first, you will have to get the application ID of the package, to do that, you can type the following commands in your Terminal to list all the installed applications:

flatpak list --app
VLC Media Player Flatpak Version
VLC Media Player Flatpak Version

Now, note down the application ID of the application you want to downgrade, in my case, I will downgrade VLC, so the application ID is org.videolan.vlc.

Get the commit code

Now, type the following command along with your application ID to get the commit code of your application:

flatpak remote-info --log flathub <Application ID>
Commit Codes Of VLC Media Player On FlatHub
Commit Codes Of VLC Media Player On FlatHub

Do not forget to press Ctrl+C to stop the output of the above command. Now, copy the commit code of the package of any specified release date.

Downgrading the package

Type the following command along with the commit code and application ID like this to install any previous version of the package :

sudo flatpak update --commit=<commit_code> <Application ID>
Downgrading VLC Media Player
Downgrading VLC Media Player

Well that’s it! We have successfully downgraded the VLC media player on our system. To verify the version, once again type the following command:

flatpak list --app
VLC Media Player Has Been Downgraded
VLC Media Player Has Been Downgraded

As you can see, VLC has been downgraded from version 3.0.18 to 3.0.17.4.

Summary

As you can see, there is no ‘downgrade’ command in the flatpak packaging system, we have just used a trick with the ‘update’ command along with the commit code in order to downgrade VLC. Do not forget that in order to copy and paste anything on/from the terminal, you have to use Ctrl+Shift+C and Ctrl+Shift+V keyboard shortcuts.