Software & AppsOperating SystemLinux

How To Install Emacs 27 on Ubuntu 18.04 LTS

Ubuntu 9

In this article, we’ll guide you through the process of installing Emacs 27 on Ubuntu 18.04 LTS. Emacs is a highly customizable and extensible text editor that is popular among developers. It’s capable of performing a wide range of functions beyond simple text editing, including project planning, debugging, and even email management.

Quick Answer

To install Emacs 27 on Ubuntu 18.04 LTS, you have two options: building from source or using the Emacs snap package. Building from source involves installing dependencies, cloning the Emacs repository, and then building and installing Emacs. Alternatively, you can use the simpler method of installing the Emacs snap package.

Prerequisites

Before we start, ensure that you have a functioning Ubuntu 18.04 LTS system with a terminal at your disposal. You should also have sudo privileges to execute administrative commands.

Installation Methods

There are two primary methods to install Emacs 27 on Ubuntu 18.04 LTS:

  1. Building from source
  2. Using the Emacs snap package

Building Emacs 27 from Source

Installing Dependencies

Before we can build Emacs, we need to install some dependencies. Use the following commands to install them:

sudo apt install --yes texinfo
sudo apt install --yes libxpm-dev libjpeg-dev libgif-dev libtiff-dev libgnutls28-dev

The apt install command is used to install software packages, and the --yes option automatically answers ‘yes’ to all prompts, allowing the installation to proceed without your intervention.

Cloning the Emacs Repository

Next, we’ll clone the Emacs repository and switch to the Emacs 27 branch:

git clone https://git.savannah.gnu.org/git/emacs.git /tmp/emacs
cd /tmp/emacs
git checkout emacs-27

The git clone command copies the Emacs repository to your local system. The cd command changes the current directory to the one where we’ve cloned the Emacs repository. The git checkout command switches to the Emacs 27 branch.

Building and Installing Emacs

Now, we can build and install Emacs:

./autogen.sh && ./configure && make
sudo make install

The ./autogen.sh command generates the configure script. The ./configure command checks your system for the necessary dependencies to build Emacs. The make command builds the Emacs binaries, and sudo make install installs Emacs on your system.

Cleaning Up

Finally, let’s remove the temporary files:

rm -rf /tmp/emacs

The rm command removes files and directories, and the -rf option recursively forces deletion.

Installing Emacs 27 using the Snap Package

If you prefer a simpler installation process, you can use the Emacs snap package:

snap install emacs --beta --classic

The snap install command installs the Emacs snap package. The --beta option installs the beta version of Emacs (which is Emacs 27 at the time of writing), and the --classic option allows the snap to have the same full access to the system as traditional packages.

Conclusion

You’ve now learned how to install Emacs 27 on Ubuntu 18.04 LTS. Whether you choose to build from source or use the snap package, you’ll end up with a working installation of Emacs 27. Happy coding!

Please note that these instructions are based on the provided context and may require additional steps or modifications depending on your specific setup. If you encounter any issues, you may need to clean your Emacs configuration and reinstall any packages or extensions you were using.

Can I use these instructions to install Emacs 27 on a different version of Ubuntu?

These instructions are specifically for Ubuntu 18.04 LTS. While they may work on other versions of Ubuntu, there could be slight differences in the installation process. It’s always recommended to consult the official documentation or community resources for your specific version of Ubuntu.

Can I use the Emacs snap package on other Linux distributions?

Yes, you can use the Emacs snap package on other Linux distributions that support snaps. However, the installation process may vary depending on your distribution. It’s recommended to consult the documentation or community resources for your specific distribution to learn how to install and use snap packages.

Leave a Comment

Your email address will not be published. Required fields are marked *