How do I install Emacs?
This answer is meant for users of Unix and Unix-like systems. Users of other operating systems should see See Where can I get Emacs for macOS, MS Windows, etc?.
Most GNU/Linux distributions provide pre-built Emacs packages. If Emacs is not installed already, you can install it by running (as root) a command such as ‘dnf install emacs’ (Red Hat and derivatives; use ‘yum’ in older distributions) or ‘apt-get install emacs’ (Debian and derivatives).
If you want to compile Emacs yourself, read the file INSTALL in the source distribution. In brief:
First download the Emacs sources. See Where can I get other up-to-date GNU stuff?, for a list of sites that make them available. On https://ftp.gnu.org, the main GNU distribution site, sources are available as
https://ftp.gnu.org/pub/gnu/emacs/emacs-VERSION.tar.xz
(Replace ‘
VERSION’ with the relevant version number, e.g., ‘28.1’.)Next uncompress and extract the source files. This requires the
xzandtarprograms, which are standard utilities. If your system does not have them, these can also be downloaded from https://ftp.gnu.org.GNU
tarcan uncompress and extract in a single-step:tar -axvf emacs-VERSION.tar.xzAt this point, the Emacs sources should be sitting in a directory called
emacs-VERSION. On most common Unix and Unix-like systems, you should be able to compile Emacs with the following commands:bashcd emacs-VERSION ./configure # configure Emacs for your particular system make # use Makefile to build components, then EmacsIf the
makecompletes successfully, you can go on to install it. (See What should I do if I have trouble building Emacs?, if you weren’t successful.)By default, Emacs is installed in
/usr/local. To actually install files, become the superuser and typemake installNote that ‘
make install’ will overwrite/usr/local/bin/emacsand any Emacs Info files that might be in/usr/local/share/info/.