TIP: How to remove app configs after uninstalling package

Have you ever been struggling to find where the app you uninstalled leaves its configuration files?

The locate command can help you find files in your system easily.

To find a configuration of an app you don’t need anymore, just do locate (app name) ~. Put the app name there and it will find files with that name in your home (~) directory (feel free to change the directory).

To delete the directories you don’t need (i think everyone knows this but here it is), do rm -r (directory). However be careful to not delete icons from your icon packs that are in .local/share/icons.

If you have a better or different way to do this post here, I’m interested to know.

No, I pay attention to where it is putting its files when I installed it.

That’s a good way to do it.:grinning_face:

can make a list of the current system install the program and then create a new list and use diff to see the differences.

How do you do it?

I have never seen pacman giving a list of files for an app at the time of its installation.

You can list the files installed for an app at the system level with pacman -Ql after the installation.

However, this won’t show anything about the config files and folders under home directory.

Those are not created by pacman but by the app itself.

Yeah that’s why I use locate to find the files. Pacman can’t do anything because the config files are made by the app, not pacman.

no you need to create a list with ls before and after and then see where new files are using diff or another diff type program. Usually I just do the entire root directory so it shows me all the files to make sure after removal all are removed from everywhere.

If possible can you please share the script that you use for this.

Also some apps and packages create files when they are first launched or run. Typical case, Firefox creates profiles. How do you handle those scenarios?

This sounds like overkill to me.

pacman -Rsn X will take care of removing the package X (that is all its installed files) and doing so for all its dependencies. One can omit -s, -n or both depending on the scope of removal in mind.

For XDG-compliant applications, most user files are under:

~/.config
~/.local/share
~/.cache
~/.local/state

For the non-compliant ones like Firefox, Thunderbird (etc.):

~/.mozilla
~/.thunderbird

Perhaps some bash wizard in the forum can come up with a script to search the home directory for the config files and folders of some $pkg.

Firefox is now XDG Compliant, you just need to recreate profiles.

Ah, good to know, thanks!

The sad result of having to much time on your hands lol.

I have no script its just ls and diff. I’m sure your smart enough to figure it out. Do note that it can take a while to search through and find each difference. As pointed out it can be way overkill.

A script/alias I use when removing an app I was only testing.