2

I want to purge emacs from debian in order to install the newer version from git but when I do apt-get purge emacs and then emacsit still runs. Any idea on how to get rid of emacs ?

3

The Debian package emacs is a metapackage. These are empty packages that only describe dependencies. As such, they don't actually contain any programs, just links to other packages to install. Further, removing a metapackage does not result in its dependencies being removed.

This feature allows package managers to use transitional metapackages to more-or-less gracefully move users from using one package to another with a different name.

So, removing the emacs package didn't actually remove any programs. That's why you needed to remove the rest of the emacs packages (apt-get purge emacs*) to get rid of emacs on your system.

Regarding the --purge flag to apt-get:

When a Debian package is removed, the configuration files are retained in order to facilitate possible re-installation. Likewise, the data generated by a daemon (such as the content of an LDAP server directory, or the content of a database for an SQL server) are usually retained.

To remove all data associated with a package, it is necessary to “purge” the package with the command, dpkg -P package, apt-get remove --purge package or aptitude purge package.

Thus, purge only removes system-installed config files (such as you might find in /etc/ or /var/), not user-generated config (usually somewhere in /home/<user>/. It would be a very bad thing if the package manager erased user-generated files!

-1

apt-get purge emacs* did the trick even tho it didn't really purge the config files (̀.emacs.d still present...)

  • 4
    Purge deletes all the system-installed config. It shouldn't ever touch .emacs.d, that's where user config goes – Tyler Apr 8 '16 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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