I see sudo apt remove package_name and sudo apt purge package_name,
but what is the difference? is one safer than the other or does one remove packages installed by that package?
Asked
Active
Viewed 2.6k times
15
Camden
- 647
2 Answers
24
You can read the manual of apt with
man apt
On line 35 you will find the following
Removing a package removes all packaged data, but leaves usually
small (modified) user configuration files behind, in case the
remove was an accident. Just issuing an installation request for
the accidentally removed package will restore its function as
before in that case. On the other hand you can get rid of these
leftovers by calling purge even on already removed packages. Note
that this does not affect any data or configuration stored in your
home directory.
So in short:
remove leaves some config files behind where purge does not. And you can even use purge if later you want to delete those config files.
urben
- 421
- 2
- 9
6
The manpage of apt-get (run man apt-get to see this) says:
remove
remove is identical to install except that packages are removed instead of installed. Note that removing a
package leaves its configuration files on the system. If a plus sign is appended to the package name (with
no intervening space), the identified package will be installed instead of removed.
purge
purge is identical to remove except that packages are removed and purged (any configuration files are
deleted too).
In a nutshell, remove keeps the configuration files while purge removes them. Both are safe, but which one to pick depends on whether you want to remove configurations.
edwinksl
- 24,109