4

I'd atom installed on the system and tried to remove it with:

pacman -Rs atom

I still have a .atom folder in /home/user and another Atom folder in /home/user/.config, not sure whether there's anymore left in any other place!

How to remove programs together with all the folders and files it created automatically over the time?

200_success
  • 5,496
  • 1
  • 26
  • 34
  • 1
    Unless you trace the program every time it runs, or you can't do this – 炸鱼薯条德里克 Aug 08 '19 at 03:26
  • 1
    Or alternatively, run the program every time in a sandbox environment, like using mount namespace to restrict its filesystem writing on one single directory. But this won't work for all program, some program will not fully function in sandbox environment – 炸鱼薯条德里克 Aug 08 '19 at 03:32
  • 1
    @炸鱼薯条德里克 Please don't answer in comments. If the answer is that it's impossible, then write that as an answer. – 200_success Aug 08 '19 at 03:42

2 Answers2

4

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).

Basically, pacman will not remove those configuration files in Home folder you will have to remove them manually. Those packages created by the application have no impact on a system after you remove the package so it won't do any harm. That is just how it works.

Usually all the configurations files created by the apps are in ~/config folder. You can just type in terminal rm -r and drag & drop folders to terminal and click Enter or whatever works best for you.

JoKeR
  • 440
  • 1
  • 8
  • 20
  • 2
    I think you meant to say `~/.config`, not `~/config`. Also look at `~/.local` and `~/.cache` for other things that were left behind. Also, some applications don't follow the [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html), so there are usually `~/.*` things to review too. – Matt Alexander Oct 17 '21 at 09:42
0

pacman can't handle files created by external applications. If the app offers an in-built uninstall option, you may try and go for that.

Some paths to look into for manual cleansing otherwise are:

  • ~/.config
  • ~/.local/share
  • ~/.cache
  • /etc
  • /etc/xdg
  • /usr/share

Just try to steer away from KDE PIM apps because that's a hell of a ride.