Does uninstalling a Linux package remove all of its files?
Asked by
+BringYourSketchbook
I've been using Linux for about a month and a half, and I'm wondering what actually happens when software is removed. If I run commands such as `yay -R`, `apt remove`, or `dnf remove`, is the package returned to the exact state it was in before installation? Assume the package manager removes every file that came with the package itself. Would application caches, configuration files, logs, downloaded package archives, dependencies, or other data created while using the program still remain?
Answers
There isnโt one universal โcompletely goneโ operation. Leftovers can include user configuration, caches, logs, package-manager download caches, manually created system configuration, and dependencies that are no longer needed. The exact cleanup options depend on the package manager and the application, so check where that program stores its data before deleting anything.
Reply to this answer
Usually, uninstalling removes the files that belonged to the package itself, but it leaves data the application created later. That commonly includes per-user caches, settings, and application data in places such as `~/.cache`, `~/.config`, and `~/.local/share`. This is intentionalโuninstalling a program generally shouldnโt delete documents or other data you created with it. Downloaded package archives may also remain in the package managerโs cache.
Reply to this answer
`apt autoremove` doesnโt clean up every leftover file. It removes packages that were automatically installed as dependencies and are no longer needed by anything else. With APT, `remove` removes the packageโs installed files but normally keeps system-wide configuration files, while `purge` also removes those package-managed configuration files. Neither one normally removes data stored in your home directory, caches, logs, or files you created yourself.
Reply to this answer
Add your answer
Answers are reviewed before publication.
+BringYourSketchbook: So even `apt purge` wonโt remove application data under my home directory? Iโd have to delete those files separately if I wanted a completely clean reinstall.