How to Lock Flatpak App Version to Prevent from being Updated in Linux

This simple tutorial shows how to lock an app package version, that is installed as Flatpak, to prevent it from being updated in Linux.

Flatpak is getting so popular today, that it’s hard to avoid installing app packages as Flatpak in Linux. However, it is so far not well integrated with many Linux distributions, including Ubuntu.

If you stick to an app with a specific version, then you can lock the package to prevent it from being updated to newer releases. And, here’s how to do the trick via few Linux commands.

NOTE: This tutorial works in most Linux, including Ubuntu, Debian, Linux Mint, Fedora, RHEL, Arch and more.

Lock A Flatpak App Version

1. Firstly, search for and open a terminal window from applications menu or ‘Activities’ overview depends on your desktop environment.

2. When terminal opens, run command to list all the applications that are installed as Flatpak in your systems:

flatpak list --app

Then copy the ‘Application ID’ for your desired application package.

3. To lock an app to current version, for example ‘Metadata Cleaner’, just run command:

flatpak mask fr.romainvigier.MetadataCleaner

In command, replace the Application ID (fr.romainvigier.MetadataCleaner) to yours. And, you may add --user or --system option in command to specify user only or system-wide package installation.

When done, you can try to update the package via flatpak update command. It should output that “nothing to do”. However, some dependency run-times can still being updated.

Un-Lock Flatpak App Version

To undo the change, just re-run the previous command with --remove option. So, the command (unlock ‘Metadata Cleaner’) will be:

flatpak mask --remove fr.romainvigier.MetadataCleaner

After that, use either flatpak update command or your system package manager to update the package.

Hi, I'm Merilyn Ne, a computer geek working on Ubuntu Linux for many years and would like to write useful tips for beginners. Forgive me for language mistakes. I'm not a native speaker of English.