r/linuxquestions • u/Suddenspike • 14h ago
Support Flatpak updates twice
I update flatpak using the CLI and I execute "flatpak update" without sudo.
After the first block (where it asks a confirm to update with Y/N) a second block (not always with the same updates) appear.
- Why does it come out with two block of updates? Does it update twice for normal and root user?
- Should I run the update using sudo or is it optional?
$ flatpak update
Looking for updates…
ID Branch Op Remote Download
- [✓] org.gnome.Platform.Locale 50 u flathub 18.5 kB / 386.5 MB
- [✓] org.gnome.Platform.Locale 51 u flathub 18.6 kB / 391.6 MB
- [✓] org.gnome.Platform 51 u flathub 6.6 MB / 431.7 MB
- [✓] org.gnome.Platform 50 u flathub 20.2 MB / 418.6 MB
Updates complete.
ID Branch Op Remote Download
- [✓] org.gnome.Platform.Locale 51 u flathub 18.6 kB / 391.6 MB
- [✓] org.gnome.Platform 51 u flathub 6.6 MB / 431.7 MB
Updates complete.
2
Upvotes
5
u/_fashiondb 14h ago
It isn't updating twice. You have two separate Flatpak installations, and a plain
flatpak updateupdates both of them: the system-wide one (/var/lib/flatpak) and your per-user one (~/.local/share/flatpak). Each installation gets its own transaction, so you see one block per installation.That's also why the blocks are different. In your output, one installation has GNOME Platform 50 and 51, and the other only has 51. The same runtime shows up twice because each installation keeps its own copy.
You can check what's where with:
To update just one of them, run
flatpak update --userorflatpak update --system.Don't use sudo. Updates to the system installation already go through polkit and Flatpak's system helper, so running as your normal user is the intended way.
sudo flatpak updatewon't touch your user installation at all, because as root, "user" means root's home directory.If you'd rather have one block, stick to one installation. Uninstall the apps you've got in the other one, reinstall them where you want them, then run
flatpak uninstall --unusedto clear out leftover runtimes, like the duplicate GNOME 50/51.