Install GNU Emacs on Ubuntu 22.04 LTS – Get the Latest Version in Minutes
If you’ve been stuck with the stock Emacs 26.3 that ships with Ubuntu and want a newer build without waiting for the next LTS release, this guide walks you through installing the official package or compiling from source so your editor stays sharp.
1. Check what’s already on your system
Run emacs --version. If it says “GNU Emacs 26.x” you’re running the default Ubuntu build. That’s fine for many users, but if you need newer packages like native tree-sitter support or the latest GTK4 integration, skip to section 2.
2. Upgrade with the official PPA
Ubuntu’s main repository is conservative; the Emacs team ships updates via a dedicated Personal Package Archive (PPA). Add it and update:
sudo add-apt-repository ppa:neovim-ppa/unstable # same source hosts Emacs too sudo apt-get update sudo apt-get install emacs
Why this matters? The PPA pulls in the latest stable release (currently 27.1 or newer) while keeping all dependencies aligned with Ubuntu 22.04’s libraries.
3. Verify the new version
After installation, emacs --version should report something like “GNU Emacs 27.1”. If it still shows 26.3, you probably had the default package pinned. Try removing it first:
sudo apt-get remove emacs
…and then reinstall from the PPA again.
4. Build from source for bleeding‑edge features
Sometimes you want the absolute newest commit, like experimental org-mode backports or the latest GTK4 support. Emacs’ build process is straightforward but requires a few dependencies:
sudo apt-get install build-essential libgtk-3-dev libgnutls28-dev \ libxml2-dev libjansson-dev libjpeg-dev libxpm-dev libgif-dev git clone https://github.com/emacs-mirror/emacs.git cd emacs ./autogen.sh ./configure --with-gtk3 make -j$(nproc) sudo make install
Why do each of these steps?
- build-essential gives you the compiler and make tools.
- The library packages let Emacs talk to your graphics stack, parse XML for Org files, and embed images.
- Running ./configure --with-gtk3 ensures it uses the newer GTK3 backend instead of the legacy GTK2 that Ubuntu ships with.
5. Clean up old binaries if you built from source
If you had the apt package installed earlier, keep the one you want by removing the other:
sudo rm /usr/bin/emacs
Or use update-alternatives to switch between builds cleanly.
6. Set your favorite launcher shortcut
After installing, add a quick “Run Emacs” entry in GNOME or your preferred desktop environment so you never have to open a terminal again.
Give those keys a whirl. Enjoy the power of GNU Emacs on your Ubuntu machine.