Does uninstalling a Linux package remove all of its files?

September 19, 2026 3 answers
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

~just passing notes+
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
coil-spring
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
hinge_offset~
`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.

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

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions