How to Install the Latest Emacs on Ubuntu

Learn various ways of installing Emacs on Ubuntu. Also, learn how to get the latest version of Emacs in this beginner's tutorial.
Warp Terminal

Emacs is one of the most popular terminal-based text editors. Actually, it’s more than just a text editor but more on that later.

This quick tutorial aims to show a few ways you can install Emacs on Ubuntu-based distributions like Linux Mint, elementary OS, etc. I’ll also share how you can get a more recent version using a PPA.

Even as a text editor, it has a steep learning curve. Therefore I have included the essential keyboard shortcuts at the end of the tutorial.

First, let’s see how to get Emacs on Ubuntu.

Method 1: Install Emacs from the Ubuntu software center

You can get Emacs easily from the Ubuntu repositories. It is available in the universe repository which should already be enabled in most systems.

If you prefer the graphical way, you can search for it in the Software Center and install it in a couple of clicks.

When you search for it, you can choose between GUI and Terminal versions, or you get both.

search for emacs
Search for Emacs

Once you choose your desired version, give it a single click, and it will open a prompt with all the details about that software. Click on the install button, and it will start the installation process.

install emacs on your system
Install Emacs on your system

That’s it, you have successfully installed Emacs without involving any commands!

Method 2: Install Emacs using terminal

If you are using an Ubuntu server or prefer the terminal, you can do all the above stuff in the terminal with just few commands.

First, enable the universe repository (not always enabled on servers) and update the package cache.

sudo add-apt-repository universe
sudo apt update

Now, you can get the terminal version of Emacs using this command:

sudo apt install emacs

If you are using Ubuntu desktop version and want to get the graphical Emacs editor, you can use this command:

sudo apt install emacs-gtk

Now, let’s open emacs to verify that the installation was successful.

emacs -nw
emacs 27.1
Emacs 27.1

While writing this, Apt contains GNU Emacs version 27.1. But what if you want the most recent version? Just follow the given steps:

Method 3: Install the most recent version of Emacs using a PPA

Important: This is not the stable version, and you may face crashes or glitches. If you are looking for something between the stable and bleeding edge, skip to the 3rd method (it also includes the way to install the most recent version through snaps).

To download the bleeding-edge version of Emacs, first, we have to add ubuntu-elisp PPA:

sudo apt-add-repository ppa:ubuntu-elisp/ppa

Now, update your repositories to get further into installation:

sudo apt update

To install the most recent version of Emacs, use the given command:

sudo apt-get install emacs-snapshot

Once you are done with the installation, you can open Emacs in the terminal by utilizing the given command:

emacs -nw
emacs 29.0.50
Emacs 29.0.50

Now, you are running the most recent version of Emacs!

Method 4: Install Emacs using snap

This is the sweet spot between the most stable and bleeding edge, as Snap will get you Emacs 28.1 at the time of writing this article.

To install Emacs classic edition, use the given command:

sudo snap install emacs --classic

As I mentioned earlier, you can also get the bleeding-edge version of Emacs through snaps. You just have to follow the given command and that’s it:

sudo snap install emacs --edge --classic

Now that you have got Emacs on your system, let me share a few tips with you.

Tips for getting started with Emacs

I would like to share some useful tips to make your Emacs experience a bit smoother. So let’s start with getting an idea of basic GUI elements.

showing scratch and file window
Showing scratch and file window

Buffer: It can be understood as a channel for communicating with Emacs and can be used for interacting with files, shell, etc.

Window: The window is used to view buffers.

Mini-buffer: A primary command line from where you’ll be applying keybindings to use Emacs.

Now, let’s have a look at some basic keybindings through which you can start using Emacs.

Keybindings to create, find, and save files:

KeybindingDescription
Ctrl+x Ctrl+f Allows you to search and open files. It will create a new file if the file already does not exist
Ctrl+x Ctrl+sSaves current buffer content to file
Ctrl+x Ctrl+wWrites changes to file

Keybindings for basic navigation:

KeybindingDescription
Ctrl+pTo move the cursor up
Ctrl+nTo move the cursor down
Ctrl+bTo move the cursor left
Ctrl+fTo move the cursor right
Ctrl+aTo move the cursor at the beginning of the line
Ctrl+eTo move the cursor at the end of the line
ESC+fTo move the cursor by one word forward
ESC+bTo move the cursor by one word backward

This was just the tip of the iceberg, the possibilities of what you can do with Emacs are endless (I mean it!).

But you are not limited to the use of GNU Emacs as there are various forks available such as remacs, DOOM Emacs, and more.

Wrapping up

Emacs is not something that you can grasp within a few days. As I mentioned earlier, it is an ecosystem itself having its own package manager, window manager, games, and a lot more.

Many new users struggle with it, but once you get a grip on it, nothing can beat Emacs in terms of productivity and efficiency.

About the author
Sagar Sharma

Sagar Sharma

A software engineer who loves to write about his experience with Linux. While reviving my crashed system, you can find me reading literature, manga, or watering my plants.

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.