man apt-get Code: [Select]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).
--purge
Use purge instead of remove for anything that would be removed. An asterisk
("*") will be displayed next to packages which are scheduled to be purged.
remove --purge is equivalent to the purge command. Configuration Item:
APT::Get::Purge.
man apt Code: [Select]install, remove, purge (apt-get()
Performs the requested action on one or more packages specified via regex(7),
glob(7) or exact match. The requested action can be overridden for specific
packages by append a plus (+) to the package name to install this package or a
minus (-) to remove it.
A specific version of a package can be selected for installation by following
the package name with an equals (=) and the version of the package to select.
Alternatively the version from a specific release can be selected by following
the package name with a forward slash (/) and codename (jessie, stretch, sid
...) or suite name (stable, testing, unstable). This will also select versions
from this release for dependencies of this package if needed to satisfy the
request.
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 apt remove --purge $foo does the very same as apt-get purge as apt purge.
I agree, but, on some games, remove --purge worked better than just plan purge
Sometimes it is wise to be careful using apt --purge packagename* as that can delete unintended packages and cause more problems than it solves.
Or if you must, at least run it with a -s/--simulate/--dry-run flag first to see exactly what it will do without doing it.
I always went by this guideline, can't find my original page, but, shows up in many others
remove - Packages installed are removed (Does NOT include configuration files)
purge - Purge is identical to remove except that packages are removed and purged. Purge meaning that any configuration files are deleted too.
This of course, does not apply to packages that hold configuration files inside the user's home folder (eg: /home/SexyNoJutsuUser), this files will not be touched (
Why does "Purge" not remove everything related to an app? )
So for example, if you were to remove Chrome, Firefox, XBMC or any other that holds some configuration files inside your /home folder, this files will stay there.
On the other hand if you were to install apache, squid, mysql or any other services similar that save their files in /etc, this configuration files will be deleted if you use purge.
This is why I always use remove --purge
apt remove --purge packagename
will remove about everything regarding the package packagename, [...]
Particularly useful when you want to 'start all over' with an application because you messed up the configuration.
Most times I use
apt-get --purge autoremove $(dpkg --get-selections | grep PACKAGE_NAME | awk '{ print $1}')
or if I feel destructive
dpkg --get-selections | grep PACKAGE_NAME | awk '{ print $1}'| xargs apt-get -y --purge autoremove