This is the approved revision of this page, as well as being the most recent.
This article or section lists commands or instructions which could potentially damage your system. Please ensure you understand the commands or instructions you are running or following before you run or follow them.
This warning exists to make users wary of running random commands or following instructions they see on the internet blindly and that they understand what they are doing to their system. Dangerous commands or instructions should be reported to an administrator immediately.
GNU Emacs is packaged in many Linux distributions[1] and can be installed from Canonical's Snap[2] or built yourself if not present in your distribution. This guide will provide information on how to install Emacs in these cases. Emacs 28.1 and above is reccomended for daily use.
Installing
Debian/Ubuntu-based distros
# Installing Emacs GTK (X11)
$ sudo apt install emacs-gtk
# Installing Emacs PGTK (Wayland)
$ sudo apt install emacs-pgtk
Fedora-based distros
# Installing Emacs GTK (X11)
$ sudo dnf install emacs-gtk+x11
# Installing Emacs PGTK (Wayland)
$ sudo dnf install emacs
openSUSE Tumbleweed
# Installing Emacs GTK (X11)
$ sudo zypper in emacs-gtk
# Installing Emacs PGTK (Wayland)
# openSUSE does not provide a package for Emacs PGTK.
# Check the "Installing From Source" section for installation steps.
Arch Linux
# Installing Emacs GTK (X11)
$ sudo pacman -S emacs
# Installing Emacs PGTK (Wayland)
$ sudo pacman -S emacs-wayland
Gentoo Linux
The installation process for Emacs is different on Gentoo Linux, as it uses USE flags instead of different package names to specify how it was built.
Add the correpsonding options to /etc/portage/package.use/emacs
:
# Emacs GTK (X11)
app-editors/emacs X gtk
# Emacs PGTK (Wayland)
app-editors/emacs -X gtk
After adding this, you can then run $ sudo emerge --ask app-editors/emacs
.
Installing from Source
Emacs provides information on how to install itself from source in root/INSTALL its Savannah repository.