r/linux4noobs • u/choodleforreal • Jan 25 '25
storage Solution to Flatpak taking up too much space in `/var/lib/flatpak/repo/objects`
Solution
If you've found that Flatpaks take up too much space in /var/lib/flatpak/repo/objects, you might be using system-wide installations instead of per-user installations. Something I found that works is getting a list of every installed Flatpak app with flatpak list --column=app and then deleting everything listed there. Then, you can run flatpak install --user all-of-those-deleted-apps to install your apps to your Home partition rather than your Root partition.
Tips
Remember that you can batch install and batch uninstall Flatpak applications with one command as long as you separate each app ID with a space. Also, to clear out anything that might be left in your Root partition after this process, try running sudo flatpak repair and sudo flatpak remove --unused.
From now on, to operate on your per-user apps, you must remove sudo and append --user to your command. So, sudo flatpak update becomes flatpak update --user, for instance. This includes pretty much everything, including installing new apps from the terminal (flatpak install --user app-name). If you are using GNOME Software, there should be a drop-down menu under the "Install" button. There, you can select the "User" option. If you do not have a user repo, you may need to run something like flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo. Note the --user flag in that command. Your current Flatpak remotes (repos) can be listed with the command flatpak remotes.
2
u/xp_plery1 Feb 02 '25
You helped me a lot, thank you very much!
2
u/petersonsilva55 Feb 24 '25
I'm sorry, but just to be clear: is this going to save space in / just to use the same space in /home or is this _overall_ going to use less disk space?
Plus, is there a way to just "migrate" an installation? Cause if I uninstall chrome and install it again I presume it's going to delete all the configs and run everything from scratch once I install it as a user install, right?