how to uninstall emacs from command line?

10,907

emacs is actually a virtual package, provided by emacs23-lucid or emacs23-nox. It's these that should be removed:

sudo apt-get remove --auto-remove emacs23-lucid emacs23-nox

The --auto-remove removes any packages which were installed to fill a dependency, but are no longer needed. In this case, it will remove packages like emacs23-bin-common.

Share:
10,907

Related videos on Youtube

sps
Author by

sps

got to know more...

Updated on September 18, 2022

Comments

  • sps
    sps over 1 year

    I have ubuntu 12.04

    I installed emacs using below commands.

    $ apt-get update
    $ apt-get install emacs
    

    Then, as expected, I could find emacs while searching in dash.

    Next I wanted to uninstall emacs, so I did:

    $ apt-get remove emacs
    

    But still I can search emacs in dash. Also I am able to open emacs and use it.

    However when I check below command.

    sps@sps-Inspiron-N5110:~$ dpkg --status emacs
    Package `emacs' is not installed and no info is available.
    Use dpkg --info (= dpkg-deb --info) to examine archive files,
    and dpkg --contents (= dpkg-deb --contents) to list their contents.
    sps@sps-Inspiron-N5110:~$ 
    

    It says emacs not installed. But how am I able to use emacs?

    To correctly ask , "How to uninstall it ?"

    I mean how do I get everything erased. I dont want any of these - source code (if any), or binary executable, or anything related to emacs - in my system, which was added when I did apt-get install emacs.

    Thanks.

  • sps
    sps about 9 years
    I tried the command you told but I am getting this error E: Command line option --autoremove is not understood . Also I tried by removing the --autoremove option. But still I get below error E: Unable to locate package emacs24-lucid E: Unable to locate package emacs24-nox . Could you please check ?
  • muru
    muru about 9 years
    @1Byn I made two mistakes, the option is --auto-remove with a hyphen, and the packages are numbered 23, since you're on 12.04 (which I didn't notice).
  • sps
    sps about 9 years
    Working now. No emacs in dash either !!. Thanks. Also can you tell this "package" is a source code or executable binary ? I mean when you say a "package" in general ?
  • muru
    muru about 9 years
    @1Byn Unless someone explicitly says "source package", "package" usually means "binary package" - but it doesn't have to be executable or even binary (such as documentation packages, software in languages like Python, packages containing common files).
  • Tony
    Tony almost 8 years
    An additional bit of information: If you're on Ubuntu 14.04, the package is emacs24, no suffix.
  • Admin
    Admin about 7 years
    Just for info.: sudo apt-get remove --purge --auto-remove emacs worked fine for me.