8

I have removed flatpak with sudo apt-get purge flatpak; however, if I run locate flatpak I find several files and several directories. Can I remove them all with rm -r or there is a "better" way? If so, how do I have to do that?

Edit

Since my output is 21909 rows long and, as @mook765 noted, nobody will ever be so crazy to read them all I think I should reformulate the question as follows: if I had a normal installation of flatpak, what would be the best way to remove it and all its files and folders?

4
  • Nope, your way will work fine. – ajgringo619 Sep 16 '19 at 18:53
  • You shouldn't do that! Without seeing the output of your command locate flatpak it's impossible to give better advice. – mook765 Sep 16 '19 at 18:57
  • Do I have to add the full output of the command? It is 21909 rows. Note that I just want to remove every file and directory left by flatpak... – Ntakwetet Sep 16 '19 at 19:13
  • That's a lot. Remove them on your own risk. No one of us will go through 21909 rows of output... – mook765 Sep 16 '19 at 19:24
9

I'm assuming you didn't uninstall the run times that flatpak applications require. I would recommend reinstalling flatpak and running the following commands:

flatpak uninstall --unused

sudo apt-get remove --autoremove flatpak

sudo apt-get purge flatpak

This should erase the majority of the files left behind from flatpak. I had around 4000 after trying it out. I decided it wasn't for me and had to look for a few hours to find a way to remove the majority of the files. These three commands had reduced nearly 4000 files that dealt with flatpak to 197.

Hope this helps.

1
5

Flatpak applications and runtimes aren't removed when you uninstall the flatpak package using apt.

I'd rather reinstall flatpak, use it to remove any leftover Flatpak packages, and then purge it. On Ubuntu 20.04 Focal:

$ sudo apt install flatpak
$ flatpak uninstall --all
$ sudo apt purge --autoremove flatpak

You can look at /var/lib/flatpak/ to check that everything has been removed. You may also need to reboot or logout/login to update application launchers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.