I noticed that there are some folders/files of previously uninstalled apps; installed and uninstalled via Gnome Software App using Flatpaks.
Disk Usage Analyser -
drill down into
So I have previously uninstalled Flathub repo version of Bottles, Heroic, Lutris, Beyond All Reason, Flight Gear, Whalebird, Microsoft Edge (this was uninstalled awhile back on F37).
It appears there are large residual files still kept after uninstalling within
Ive also uninstalled Epic Game Store and Heroic but both folders remain
It does not appear to be just
F38 uninstalled apps but also those uninstalled in
I am unclear if there is a command would remove all these but also if when I uninstall if I am missing something.
To uninstall, i do so, via Gnome Software App and it is showing the app isn’t installed
Some system details below
I can manually delete the folders and files, but I am assuming when you uninstall via the App store, it would remove the files. On Windows, I previously used CCleaner to find old residual items to remove and clean up disk, registry etc…
Happy to be corrected if this the expected behavior or any guidance if I need to do something to fix this.
No, it doesn’t. Uninstalling a package removes all files and folders that were installed or created when you installed it, and only those files and folders. If you want those files/folders that were created by the package itself removed, you need to do it yourself, just as you did in Windows.
Thanks @sideburns - so rather than uninstall via the Gnome Software App, it would be therefore be better practice to do using a different method, which would remove all files/folders created/installed by the app.
In the meantime, I’ve installed
Czkawka from the Software store to try out
any recommendations on what commands to use when uninstalling to completely remove or any guidelines on best practices going forward please?
There are no ways to have the automatic installer uninstall the data/config files that the app creates. Those are located in/under the users home directory and it is up to the user to remove those file when no longer needed. This is what you were told above and it remains true in almost all cases.
If you wish an app to remove all the files it has created before uninstalling then it seems reasonable to contact the app developer and work with them to figure out how that may be done.
Installing an app creates/installs certain files and the installer can remove those same files.
Running the app may create additional files and those are the ones the installer has no knowledge of and cannot remove. Only the app knows what those files may be.
As a kludge to potentially assist you may be able to do a tree or an ‘ls -R’ of the home directory before installing an app, then after removing that app repeat the ‘ls -R’ and look for differences that may have been created. This would only work cleanly if there were only one app installed, used, then removed before the second run since each app may create its own files.
There are also tools that, while extreme overkill, could be used to detect changes in the users home directory and might allow one to identify new files created. This site talks about some of them, but they are mostly intended to detect and prevent system changes on servers, not in a users home directory which is usually quite dynamic.
There are some exceptions, but generally on Linux:
Package managers only remove files that are part of the package.
- Files created by programs after you use them are not part of the package.
- This means reinstalling a package usually does nothing, since it removes and installs exactly the same files. Don’t reinstall packages hoping it will magically fix issues like on Windows. If you want to “reset” a program, temporarily remove its config files in your home directory.
Package managers never touch users’ home directories.
Fedora has a policy that packages must not install any files to home dirs, so logically, removing Fedora packages will not remove any files from home dirs.
- Package managers are run at the system-wide level with root permissions. If they removed files from home dirs, then all users would lose files without warning when one admin removed the package (or only the user issuing the uninstall command loses their files, which doesn’t make sense either). So regardless of distro policies, package managers should not touch home dirs in normal use.
Flatpak is different from traditional package managers like dnf or apt. Many (but not all) Flatpak apps store their data in isolated folders in
~/.var/app instead of mixed in your home folder.
Because of this, you can delete an app’s data folders when you uninstall it:
flatpak uninstall --delete-data <app id>
Make sure there aren’t files you want in the app’s data folder though, like documents, screenshots, saved games etc. Files outside of the data folder still won’t be removed.
There is no “best practice” for cleaning up files, because there’s no way to know which files you consider important.
It may seem obvious to you that the games should be removed when you uninstall the launcher. But say you use a program like LibreOffice to create documents. How would a package manager 1) track the files created by programs, and 2) differentiate between files that you consider important (like documents), and files you consider junk (like games after you’re done playing them)?
I don’t recommend using any “cleaner” type apps on any OS. At best, some of their advertised benefits are placebos. At worst they could cause problems deleting the wrong files or deleting files unnecessarily. For example, many programs use caches to speed up repetitive operations. Deleting the cache of a program doesn’t improve its performance or save you any space, because the next time you use the program, it will have to spend more time to recreate the cache.
Czkawka is not one of those “cleaner” apps though. It’s a duplicates finder which has many legitimate uses (like finding duplicate photos in albums).
Thank you @computersavvy and @jn64 - this has been very educational for me… much appreciated!
I hope this helps others (newbies like myself) understand better as it has for me.