How to install the Emacs text editor on Linux
Emacs is an open source, free text editor for Linux. It can be used for everything from basic text and word processing, to code editing, scripting, and even a full-fledged development environment.
The Emacs tool is quite old and has been around for quite a while. Due to its age, the app is available on Ubuntu, Debian, and other popular Linux operating systems, as well as a Snap package or Flatpak.
To learn how to install the Emacs text editor on Linux, launch a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T and follow the instructions below that match the Linux operating system you are using.
Ubuntu instructions
On Ubuntu Linux, the Emacs text editor is available in the “Ubuntu Main” software repository. If you’re running Ubuntu, use one of the Apt commands in your terminal window.
GTK release
The GTK release of Emacs is the version of the text editor that average people find themselves using. The reason is that the GTK version comes with an easy to use GUI that doesn’t require memorising custom keyboard shortcuts, etc.
If you’d like to install the GTK release of the Emacs text editor on Ubuntu Linux, enter the following Apt command.
sudo apt install emacs-gtk
CLI release
Ubuntu Linux has a CLI version of Emacs readily available in the “Ubuntu Main” software repository, alongside the GTK version. The CLI one is preferred by programmers who often have to work through the terminal, and like the keyboard-shortcut workflow.
To get your hands on the CLI release of Emacs for Ubuntu, enter the command below in a terminal window.
sudo apt install emacs-nox
Debian instructions
Debian Linux users can install the Emacs text editor on all currently maintained releases of Debian Linux, including Debian 10, 9 and 8.
The Emacs text editor is provided to Debian fans through the “Debian Main” software repository. To get it working on your system, enter one of the Apt-get commands below.
Traditional Emacs installation
On Debian 9 and 8, there’s no way to install just the CLI or GTK release. Instead, users who want to use the Emacs text editor can only install the “emacs” package and use what Debian provides.
sudo apt-get install emacs
GTK release (Debian 10 only)
On the newest release of Debian (version 10) and looking to install the GTK release of Emacs on your system? Use the following Apt-get command in a terminal window to get it up and running.
sudo apt-get install emacs-gtk
CLI release (Debian 10 only)
Only need the CLI release of Emacs on your Debian 10 PC? Install the “emacs-nox” package with the Apt-get package manager, and you’ll be good to go!
sudo apt-get install emacs-nox
Arch Linux instructions
Arch Linux has the absolute latest release of the Emacs (GTK and CLI versions) in their software repositories. However, the programs aren’t in software repositories that many Arch users have enabled by default. So, before we can go over how to get the program, the software repositories must be enabled.
Open up the /etc/pacman.conf configuration file in the Nano text editor using root access.
su -
nano -w /etc/pacman.conf
Once inside of the Pacman configuration file, scroll through and find “Extra” and remove the # symbol from in front of it, along with the lines directly below it.
Next, move through the file and locate “Community” and remove the # symbol from in front of it, just like the “Extra” one. Be sure to also get rid of the # symbols directly below the “Extra” repo as well.
After enabling the “Extra” and “Community” repos, save the edits by pressing Ctrl + O on the keyboard. Then, close Nano with Ctrl + X.
Re-sync the Pacman package manager:
pacman -Syy
GTK release
To install the GTK release of Emacs on Arch Linux, install the “emacs” package.
pacman -S emacs
CLI release
Just need the command-line version of the Emacs text editor on your Arch PC? Install the “emacs-nox” package.
sudo pacman -S emacs-nox
Fedora instructions
Need access to Emacs on your Fedora Linux PC? If so, you’ll have to install the “emacs” package from the “Fedora x86_64” repository with the Dnf package manager.
Note: using 32-bit Fedora? Emacs is also available in the “Fedora i386” repo.
sudo dnf install emacs
OpenSUSE instructions
On all OpenSUSE Linux releases, the Emacs text editor is available through the “OpenSUSE Oss all” software repository. To get it working, open up a terminal window and use the Zypper package manager.
sudo zypper install emacs
Snap package instructions
The Snap store has a version of Emacs available, which is great news, especially for those on lesser-known Linux distributions that may not carry Emacs or that do not offer a relatively new release.
Note: before attempting to install Emacs from the Snap store, please ensure you have the Snapd runtime working on your system. For more information, check out our post on Snap packages.
To install the Snap version of Emacs, use the snap install command.
sudo snap install emacs-tealeg
Flatpak instructions
Emacs is available as a Flatpak, thanks to the people over at Flathub. If you’d like to get your hands on it, head over to our guide and learn how to enable the Flatpak runtime. Then, once the runtime is enabled, enter the commands below to get it going.
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.gnu.emacs