Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
What is the correct way to completely remove an application?

Is there any difference between

sudo apt-get purge <package-name>


sudo apt-get remove <package-name>  


I often see people recommend one or the other.

In other words, what does apt-get purge remove that apt-get remove doesn't?

share|improve this question

marked as duplicate by stephenmyall, Florian Diesch, RolandiXor, Raja, Ringtail Dec 22 '12 at 2:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 94 down vote accepted

As the man apt-get page says:

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.

share|improve this answer
Purge can be used on a meta package to remove it, while leaving the underlying package intact. If you want to upgrade the base system without affecting postgres, you can apt-get purge the postgres meta package and then upgrading from Debian 7- Debian 8 will leave your postgres version untouched. – boatcoder Jul 7 at 14:33

An excerpt from my answer on another question:

  • apt-get remove packagename
    will remove the binaries, but not the configuration or data files of the package packagename.
  • apt-get purge packagename, or
    apt-get 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.
share|improve this answer

apt-get purge removes configuration files, while apt-get remove does not.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.