the problem is, i removed a package with it’s dependencies and after that i found in /etc a folder from the package(/etc/package_name/package_name.json).
it’s possible to remove packages with all files and folders.
Pacman saves important configuration files when removing certain applications and names them with the extension: .pacsave. To prevent the creation of these backup files use the -n option:
pacman -Rn *package_name*
Note: Pacman will not remove configurations that the application itself creates (for example “dotfiles” in the home folder).
It isn’t entirely possible for pacman to do this. pacman removes the files it installs only. However, applications create files on their own and these will never be removed by pacman.
In my opinion, this option is poorly named and somewhat misunderstood. What it does is not “remove config files”. It stops the creation of .pacsave files for files in the package’s backup array.
Most packages don’t actually have anything in the backup array so this option usually does nothing.
I remove all pacman installed packages with -Rns option, because I want to be sure it’s completely off the system, even if I plan to reinstall it at a later date.
So should I still be doing -Rns option, just in case there are unwanted configuration files?
I’ve used -Rns countless times, but I’ve also used just -R, to see which one removes more or less. 95% of the time for me, -R removes no more, no less than -Rns, so in practice -Rns isn’t really as effective as we’d like to think it is. Still useful I suppose, but nowadays I just stick with -R when I want to remove anything.
-Rs removes the dependencies of the package. If the package has no dependencies
-R and -Rs will do the same thing. Otherwise -Rs will remove the dependencies.
checking dependencies...
Package (1) Old Version Net Change
gthumb 3.12.2-1 -12.54 MiB
Total Removed Size: 12.54 MiB
:: Do you want to remove these packages? [Y/n] n
$ sudo pacman -Rs gthumb
checking dependencies...
:: gdk-pixbuf2 optionally requires libjxl: Load .jxl
:: imagemagick optionally requires libjxl: JPEG XL support
:: imlib2 optionally requires libjxl: JXL loader
Package (4) Old Version Net Change
gperftools 2.9.1-2 -2.83 MiB
gst-plugin-gtk 1.20.1-1 -0.06 MiB
libjxl 0.6.1-3 -16.18 MiB
gthumb 3.12.2-1 -12.54 MiB
Total Removed Size: 31.61 MiB
:: Do you want to remove these packages? [Y/n] n
With only -R all the dependencies which are not dependencies of other packages will not be removed. They will become the so called orphans.
If you use only -R to remove packages, you might want to check if there are some orphans on the system and if you want to remove them.