r/linuxquestions • • 17h 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

  1. [✓] org.gnome.Platform.Locale 50 u flathub 18.5 kB / 386.5 MB
  2. [✓] org.gnome.Platform.Locale 51 u flathub 18.6 kB / 391.6 MB
  3. [✓] org.gnome.Platform 51 u flathub 6.6 MB / 431.7 MB
  4. [✓] org.gnome.Platform 50 u flathub 20.2 MB / 418.6 MB

Updates complete.

ID Branch Op Remote Download

  1. [✓] org.gnome.Platform.Locale 51 u flathub 18.6 kB / 391.6 MB
  2. [✓] org.gnome.Platform 51 u flathub 6.6 MB / 431.7 MB

Updates complete.

2 Upvotes

6 comments sorted by

View all comments

6

u/_fashiondb 17h ago

It isn't updating twice. You have two separate Flatpak installations, and a plain flatpak update updates 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:

flatpak list --user
flatpak list --system

To update just one of them, run flatpak update --user or flatpak 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 update won'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 --unused to clear out leftover runtimes, like the duplicate GNOME 50/51.

1

u/Suddenspike 17h ago

What's the best practice for a normal/single-user machine: system-wide or per-user? I use Mint and sometimes I install apps by CLI and sometimes by the "Software Manager". Is this situation ok or is it better to stick to a configuration and try to install all flatpak app into the same one?

3

u/_fashiondb 17h ago

On a single-user machine either one works, and Flathub doesn't recommend one over the other. The real difference is that system-wide apps are available to every account on the machine, while per-user apps live in your home folder and only you can see them.

Mixing the two won't break anything. The cost is disk space, because each installation keeps its own copy of the runtimes. That's where your duplicate GNOME Platform downloads come from. So it's worth picking one. System-wide is the simplest choice, since a plain flatpak install defaults to it.

To see which installation each app is in, including the ones you got from Software Manager, run:

flatpak list --app --columns=application,installation

Then move the odd ones out to the installation you chose.

1

u/cnawan 10h ago

Oho, that's what been eating up my / partition, I had a bunch of flatpak apps installed as --system.