Now that GNU Emacs 25.1 has been released, it is time for my customary “how to install Emacs 25.1 on a recent Ubuntu” post. In my case I’m using XUbuntu 16.04, but the instructions are pretty much the same for just about every recent Ubuntu version. The package versions of the referenced packages differ, but the package names haven’t changed since I first published one of these posts.
I make sure that the build-essential package is installed, plus to make things easier I’m also installing the build dependencies for Emacs 24. That way the Emacs 25.1 build should have the same options enabled as the official Emacs 24 package you get with Ubuntu.
sudo apt install build-essential
sudo apt-get build-dep emacs24
I already had build-essential installed, but not the build dependencies. Don’t be surprised if apt-get wants to install a fair number of packages as build dependencies - it installed 171 new packages on my machine.
If you do get the following error when you try to run the apt-get build-dep step, you need to add the ‘source code’ repository to your Ubuntu software repositories in Settings/Software and Updates:
E: You must put some 'source' URIs in your sources.list
At the same time, you will want to download the Emacs sources via the Emacs download page and untar it into a convenient directory. Then it’s simply a matter of running ./configure and kicking off the build:
./configure --prefix=$HOME/local
make && make install
I prefer to install my home-built Emacsen and other binaries into a directory tree that is local to my user directory, hence the –prefix argument above. That way, I don’t run into conflicts with system packages.
That’s it, a quick check that we have a working version of Emacs 25.1 and we’re in business:
~/local/bin/emacs --version
GNU Emacs 25.1.1
Copyright (C) 2016 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
Of course I also have the GUI version for the time when I’m not ssh’d into a remote server:
Happy Emacsing! I’m off to check out the new features in Emacs 25.