How to remove programs completely on Arch Linux, including files that it created in home directories?

18,043

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.

Share:
18,043
200_success
Author by

200_success

Former moderator of https://codereview.stackexchange.com

Updated on September 18, 2022

Comments

  • 200_success
    200_success almost 2 years

    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?

    • 炸鱼薯条德里克
      炸鱼薯条德里克 almost 5 years
      Unless you trace the program every time it runs, or you can't do this
    • 炸鱼薯条德里克
      炸鱼薯条德里克 almost 5 years
      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
    • 200_success
      200_success almost 5 years
      @炸鱼薯条德里克 Please don't answer in comments. If the answer is that it's impossible, then write that as an answer.
  • Matt Alexander
    Matt Alexander over 2 years
    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, so there are usually ~/.* things to review too.