Pin a Flatpak App to a Fixed Version on Wayland
Flatpak apps are great for sandboxing, but the automatic update loop can be a nuisance when a new release breaks a workflow or introduces a regression. On a Wayland‑based desktop (GNOME, KDE, etc.) the update mechanism is the same as on X11, so the steps below work everywhere.
1. Inspect the current version
flatpak info com.spotify.Client
The output shows the installed commit hash and the remote’s latest commit. If you’re running a version that you want to keep, note the commit hash:
flatpak info --show-commit com.spotify.Client
2. Pin the app with a mask
A mask tells Flatpak to ignore newer commits for that app. It’s the quickest, most explicit way to stop updates.
flatpak mask com.spotify.Client <commit-hash>
Replace <commit-hash> with the value from step 1. After that, flatpak update will skip the app, and flatpak info will still report the masked commit.
Trade‑off: The app will never receive security patches until you lift the mask. Use this only if you’re comfortable monitoring the upstream repository for critical fixes.
3. Disable auto‑update globally (optional)
If you prefer a blanket rule that stops all Flatpak updates, adjust the configuration:
flatpak config --global --set 'update.auto' false
This disables the flatpak-update.timer that runs automatically. You can still trigger updates manually with flatpak update.
4. Override the app’s update policy
Flatpak allows per‑app overrides that set the no-update flag. This is a lightweight alternative to masking:
flatpak override --user --no-update com.spotify.Client
The flag is stored in ~/.var/app/com.spotify.Client/flatpak/override. Removing the override re‑enables updates.
5. Verify the result
flatpak update --app com.spotify.Client
The command should report “No updates available” even if the remote has a newer commit.
6. Keep an eye on security
Pinning an app means you’ll miss patches for bugs, including CVEs. Check the app’s upstream issue tracker or the Flatpak release notes before deciding to stay on an older commit. If you’re concerned about a specific vulnerability, you can temporarily mask the app until a patched release is available.
7. Clean up when you’re ready
To lift a mask or override:
flatpak mask --remove com.spotify.Client
flatpak override --user --reset com.spotify.Client
Then run flatpak update to bring the app back to the latest commit.
Flatpak’s flexibility lets you balance stability and security without touching Wayland or the compositor. Use masks for critical, long‑term pinning; use overrides for short‑term workarounds. Either way, the commands stay the same across all modern distributions.
See also
- Stopping the Journal from Flooding me with Repeated Wi‑Fi Disconnection Notices
- The day my Downloads folder vanished after a simple umask change: my recovery steps
- Replacing Ubuntu’s Default DNS with Dnsmasq: Fixing Stale IPs in My Home Network
- Why my nightly rsync backup disappeared after switching to a systemd timer – and how I fixed it with 'Persistent=true
- Taming My Daily Backup Script’s CPU Spikes with `nice` and `ionice`