I downloaded Emacs source files, and installed it using make. After installing Emacs successfully, I manually removed the downloaded source files to save disk space. Now I want to remove Emacs and I tried to use sudo apt-get purge emacs. But it says Emacs has not been installed and will not be removed. But I can run Emacs by typing emacs in the terminal. Also the command which emacs shows the result /usr/local/bin/emacs.

Why can't apt-get detect it? How can I remove Emacs completely in this situation? My OS is Ubuntu 12.04, and my Emacs version is 24.3.1.


9 Answers 9


You haven't installed Emacs with the package manager. As you have installed it from source tarball, try this way.

  1. Check emacs version.

    $ emacs --version
  2. Download the same emacs version you have installed in the past.

    $ wget https://ftp.gnu.org/gnu/emacs/emacs-$VERSION.tar.xz
  3. Extract tarball.

    $ tar xJvf emacs-$VERSION.tar.xz
  4. Run ./configure to generate the make file. If you remember the option you have given when you install it, add those command line flags, too. (e.g. --with-x=no)

    $ cd emacs-$VERSION
    $ ./configure
  5. Do make uninstall to uninstall.

    $ sudo make uninstall



It is not enough to

sudo apt-get remove emacs

You have to do

sudo apt-get remove emacs emacs23 emacs24 emacs25 emacs26 \
                    emacs-bin-common emacs-common emacs-el 


locate emacs
  • 1
    + emacs24 too
    – deadfish
    Nov 7, 2018 at 21:40
  • I am not sure this would help or apply to the OP. It looks like he compiled and installed from source.
    – haziz
    Dec 30, 2019 at 0:33

apt-get can not detect the applications which you have installed from source.Actually every source file will have uninstall script also but unfortunately you have removed the source file.

You may still do this. In the terminal type as

locate emacs

it will list all it footprints in the system , then remove those emacs footprints by using rm command carefully.

  • So I should keep the source file in order to remove the application in the future. When I decide to remove it, I run make uninstall, and then delete the downloaded source file. Is that right? Should I run make clean after make uninstall? Nov 15, 2013 at 2:50
  • 1
    @YangWenhao It may be make remove or some other command, but yes, when you install software from source, you need to keep the source code around so you can do make uninstall or similar to remove the software. Source-built software isn't managed by the packaging system because it's not existing as a Debian package.
    – Thomas Ward
    Nov 15, 2013 at 3:06
  • @ThomasW. Thank you for your help. I know the right way. Nov 15, 2013 at 6:04
  • 4
    locate emacs will not "list all it footprints in the system", it will simply show you files which have 'emacs' in the name. With a program as large as emacs, many of the added files likely don't have 'emacs' in the name or path.
    – Steven K
    Nov 16, 2013 at 20:05

For me removing emacs-gtk worked

sudo apt-get remove emacs-gtk
  • Thank you so much. This was exactly my problem.
    – wbadry
    Jun 18, 2021 at 15:10

Using apt

sudo apt remove emacs

followed by

sudo apt autoremove

this will remove both emacs-terminal and emacs-GUI

sudo apt remove --purge emacs-bin-common emacs-el emacs-gtk

This command worked for me


Using checkinstall

  1. Close all package managers
  2. Download the archive again
  3. Compile emacs again
  4. Install the package checkinstall

    sudo apt-get install checkinstall
  5. Install emacs with

    sudo checkinstall

    to overwrite you previous installation and to have a deb package. That's the trick.

  6. Remove the emacs package, the command is shown after the installation via checkinstall.


I tried this and worked for me :

  1. Go the emacs installed Icon in the apps:
  2. Click the right button > Show Details
  3. Click on the uninstalled button.
  4. Go to terminal > emacs--version.
  5. Nothing is there.
  6. Enjoy.

This worked for me to uninstall emacs which was installed through ppa:kelleyk/emacs.

I initially tried

sudo apt purge --autoremove emacs$VERSION

it removed some emacs files but the emacs itself does not removed. when I went to my terminal and do emacs --version, I can still open emacs.

I then reinstalled emacs$VERSION once more

sudo apt install emacs$VERSION

then again purged the emacs

sudo apt purge --autoremove emacs$VERSION

Now its completely removed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .