You are not logged in.
I know that I can use pacman -R to remove a package without removing its configuration files.
How can I list packages that have been removed but still have configuration files on the system?
Also how can I remove a package's configuration files after the package has already been removed?
Thanks
Last edited by Bydo (2023-08-28 12:02:54)
Offline
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I'm not asking about ghost files created by a package after installing it. I'm asking about the configuration files installed as part of a package.
In Arch, to remove a package along with its configuration files, you add -n to pacman -R.
How do I list the packages that have been removed but have residual configuration files remaining, and then remove the files?
In Debian, these configuration files can be identified by using dpkg -l | grep ^rc, and removed using apt purge <package name>.
How do I do this in Arch?
Last edited by Bydo (2023-08-28 12:43:26)
Offline
Then, when using pacreport --unowned-files as the root user, any unowned files will be listed if the associated package is no longer installed (or if any new files have been created).
Paperclips in avatars? | Sometimes I seem a bit harsh — don’t get offended too easily!
Offline
Then, when using pacreport --unowned-files as the root user, any unowned files will be listed if the associated package is no longer installed (or if any new files have been created).
So is there an equivalent of Debian's apt purge <package> to remove all configuration files left by packages that have been removed (i.e. pacman -Rn but for packages that have been removed but have left-over configuration files)?
Offline
You're aware that you can use output of one command as input for another command?
Offline
I'm not asking about ghost files created by a package after installing it. I'm asking about the configuration files installed as part of a package.
They're the same thing. Once a package is removed (without removing it's configuration files) pacman no longer has a record of those files - so they are indistinguishable from other unmanaged files.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Once a package is removed (without removing it's configuration files) pacman no longer has a record of those files.
Debian does: apt purge <package> removes a package's configuration files even when the original package is no longer installed. Is there not an equivalent in Arch? I wouldn't expect such a shortcoming.
Offline
EDIT: see the note on ".pacsave" below as that makes this much easier. Just remove .pacsave files if that's your goal. However, I doubt this is your real goal and there is really an X-Y question here likely about user created config files.
Last edited by Trilby (2023-08-28 13:37:31)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
You're aware that you can use output of one command as input for another command?
Piping output wholesale won't work, since some unowned files are not from removed packages, and I don't want to remove them. I only want to remove residual files from removed packages.
Offline
If the config files weren't modified, they were removed with -R. If they were modified, they were saved with a .pacsave extension and pacman notified you about it. That's it, there is no more.
Offline
It looks like I'll have to always to add -n to pacman -R. But this workaround isn't ideal and shouldn't be necessary.
Offline
How is that a workaround? If you always want to remove all config files that you have customized, that's normal.
Forget what you know from apt.
Offline
If the config files weren't modified, they were removed with -R. If they were modified, they were saved with a .pacsave extension and pacman notified you about it. That's it, there is no more.
It looks like all I have to do it delete all .pacsave files then. Is there a command to remove all .pacsave files, other than find / -name '*pacsave' -delete?
Offline
How is that a workaround? If you always want to remove all config files that you have customized, that's normal.
Forget what you know from apt.
I wasn't aware that pacman -R automatically deletes any original configuration files and renames all altered ones to *.pacsave.
Offline
Also maybe check ~/.config and ~/.local/share or even dotfiles in your ~.
Many programs create config files in your own home folder.
"Why join the navy if you can be a pirate?"
- Steve Jobs
Offline