How to Install GNU Emacs 25.1 in Ubuntu 16.04

Last updated: September 18, 2016

emacs-icon245

GNU Emacs text editor finally reached the 25.1 release last night. Here’s how you can install it in Ubuntu 16.04 and Ubuntu 16.10.

Emacs 25.1 release highlights:

  • Emacs can now load shared/dynamic libraries (modules)
  • Experimental support for Cairo drawing
  • Enhanced network security (TLS/SSL certificate validity and the like)
  • New minor mode ‘electric-quote-mode’ for using curved quotes as you type
  • Character folding support in isearch.el
  • Xwidgets: a new feature for embedding native widgets inside Emacs buffers
  • New and improved facilities for inserting Unicode characters

How to install Emacs 25.1 in Ubuntu 16.04:

Besides installing the latest snapshot via the daily build PPA, it’s easy to build the 25.1 stable release by following the steps below one by one:

Remove previous Emacs if any before getting started:

1. Open terminal (Ctrl+Alt+T) and run command to install build tools:

sudo apt install build-essential checkinstall

Type in your password (no visual feedback) when it asks and hit Enter.

2. Then install the build dependencies via command:

sudo apt-get build-dep emacs24

3. Now download the source at ftp.gnu.org/gnu/emacs/, then extract:

4. Open terminal and navigate to the “emacs-25.1” folder via command (or select “Open in terminal” from its context menu):

cd ~/Downloads/emacs-25.1

5. In the same terminal window, once you’re in the source folder, run the commands below one by one:

./configure

make

For the default GTK version in Ubuntu 16.04, there’s a known bug for multiple displays.

6. Finally use checkinstall command to create .deb and install Emacs 25.1:

sudo checkinstall

While running the command, answer on screen questions, e.g., install docs, type package description, change package name, version, etc.

Once done, Emacs 25.1 is installed on your system and you can remove it anytime by running the command in the prompt with sudo privilege:

In my case it’s:

sudo dpkg -r emacs-25

And the last command create a .deb package in the source folder, and it can be used in another Ubuntu machine to install Emacs 25.1 (need to manually install dependencies via step 2).

Finally, run command emacs to launch the text editor, or launch it from Unity Dash (App Launcher) at next login (or next boot).

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via ubuntuhandbook1@gmail.com Buy me a coffee: https://ko-fi.com/ubuntuhandbook1 |

11 responses to How to Install GNU Emacs 25.1 in Ubuntu 16.04

  1. I am not able build emacs 25.1 with xwidgets support in ubuntu 16.04. Can you please guide to do this?

    • sudo apt-get install build-essential texinfo libx11-dev libxpm-dev libjpeg-dev libpng-dev libgif-dev libtiff-dev libgtk2.0-dev libncurses-dev libxpm-dev automake autoconf -y

  2. Nicolas Vaughan October 6, 2016 at 7:18 pm

    You may also want to do:


    sudo make install

    instead of:


    make
    sudo checkinstall

    if you wish to compile and install without creating the .deb file.

  3. should you use dpkg -i emacs-25 instead of dpkg -r emacs-25?

  4. No targets specified and no makefile found.

  5. No targets specified and no makefile found.

  6. For configure, you should use:

    ./configure –prefix=/usr/local/bin

    If you don’t want apt to overwrite your installation of emacs on upgrade.

    • Didn’t use ‘–prefix=/usr/local/bin’ but mine still installed there, any thoughts on why?

  7. Nice tutorials Ji, thanks especially the ‘sudo checkinstall’ part…

  8. for the “make” command
    —-make: *** No targets specified and no makefile found. Stop.—-

  9. Thank you for this very useful guide.