Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cleanup flatpak repo folder?

Tags:

flatpak

After trying to build the gitg flatpak I noticed my /var/lib/flatpak/repo folder has become very large. enter image description here I'm assuming these are build files? Is there a good way to clean these up?

I'm using Flatpak 1.4.0.

like image 502
Peter Uithoven Avatar asked Jun 05 '19 21:06

Peter Uithoven


People also ask

Can I delete Flatpak repo?

Uninstall a Flatpak applicationYou can use the uninstall option with the application id to remove the installed Flatpak package.


2 Answers

For those landing here who arent building stuff, /var/lib/flatpak/repo is also where every flatpak installs ends up, and when you run upgrades it doesn't clean itself up. For --user installed packages it would be ~/.local/share/flatpak/.

Discovered that answer on this post.

flatpak uninstall --unused

Before

[root@laptop flatpak]# du -sh .
8.4G    .

After

[root@laptop flatpak]# du -sh .
4.3G    .
like image 101
gregswift Avatar answered Sep 21 '22 05:09

gregswift


/var/lib/flatpak/ & ~/.local/share/flatpak/ are the system & user install location for installed runtimes (e.g. org.gnome.Platform) and applications (e.g. org.gnome.gitg). The repo/ directory is where all the checksum-ed binary files are stored, it's like a git repo. They are not the build files unless you include the downloaded org.gnome.Sdk//master runtime, which would be installed here. But the SDK is shared and not specific to gitg.

If you built with flatpak-builder they would be in a folder called .flatpak-builder & the build folder (what ever you called it). So if you ran the following in a directory like ~/gitg-build-folder/:

flatpak-builder --force-clean --repo=gitg-repo build org.gnome.gitgDevel.json

Delete ~/gitg-build-folder/build & ~/gitg-build-folder/.flatpak-builder to remove any build files produced during building gitg.

If you don't need to build anything in the future you could delete org.gnome.Sdk//master, however, a lot of the files are de-duplicated as org.gnome.Platform is also installed. You might also have the *.Debug SDK extension installed which would take a lot of space.

Answer from duplicate question on Flatpak GitHub: https://github.com/flatpak/flatpak/issues/2945#issuecomment-499498706

like image 45
Mr. Octus Avatar answered Sep 18 '22 05:09

Mr. Octus