Ubuntu – How to install the *latest* version of Emacs

command lineemacssoftware installation

I've downloaded the .tar.xz file from the GNU Emacs page, and extracted it, but now I have a huge directory full of files, and I have no idea what to do with them. The README is unhelpful, too.

I am using Ubuntu 18.04 (Bionic Beaver) in Windows Subsystem for Linux (WSL) 1. That means I only have a CLI to work with, unless I use an external X server.

I don't want any of the apt packages for Emacs. I know how to install them, and I want the latest version (GNU Emacs 26.3).

Best Answer

To install WSL 2, you will need the following requirements:

  • Windows 10 Insider Preview Build 18917 or higher.
  • WSL 2 will be generally available in Windows 10, version 2004 and later.

The latest stable version of Emacs 26.3 is a native Ubuntu package and can be installed in WSL 2 in all currently supported versions of Ubuntu with the following command:

sudo snap install emacs --classic

The beta version (27 at the time of the answer) can be installed with:

sudo snap install emacs --channel=beta --classic

The latest development version of Emacs 28.0 can be installed with the following command:

sudo snap install emacs --channel=edge --classic