Does uninstalling a Linux package remove all of its files?

0
0
Asked By MellowCedar42 On

I've been using Linux for about a month and a half, and I'm wondering what really happens when software is removed with commands such as `yay -R`, `apt remove`, or `dnf remove`. If a package is uninstalled, is the system returned to exactly how it was before installation? I'm especially curious about application caches, configuration files, downloaded package archives, logs, dependencies, and files created while using the program.

4 Answers

Answered By BrightOtter7 On

Usually, uninstalling removes the files that belonged to the package itself. It generally does not remove data created by the program afterward, such as personal files, caches, or user configuration. Those may remain so that reinstalling the application can restore your previous setup.

Answered By NimbleQuartz19 On

User-specific leftovers commonly remain in locations such as `~/.cache`, `~/.config`, and `~/.local/share`. System-wide configuration, logs, and other files manually created outside the package can remain too. Package managers avoid deleting these automatically because they might contain settings or data you still want.

Answered By SilverPanda31 On

The package manager may also keep the downloaded package archive in its cache. Dependencies that are no longer required can usually be cleaned up with the package manager’s dependency-removal command, but that is separate from deleting application data. In practice, an uninstall removes the managed program files, not every trace associated with the software.

Answered By QuietMaple58 On

`apt autoremove` is not a general cleanup command for every leftover file. It removes packages that were automatically installed as dependencies and are no longer needed. With APT, `apt purge package-name` removes the package plus its system-level packaged configuration files, including leftovers from a previously removed package, but it still does not remove data in your home directory.

MellowCedar42 -

So `purge` is more thorough than `remove`, but I would still need to check my home directory and package cache separately?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.