7.1 How do I install Emacs?

This answer is meant for users of Unix and Unix-like systems. Users of
other operating systems should see the series of questions beginning
with Emacs for MS-DOS, which describe where to get non-Unix source
and binaries, and how to install Emacs on those systems.

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:

Next uncompress and extract the source files. This requires
the gzip and tar programs, which are standard utilities.
If your system does not have them, these can also be downloaded from
https://ftp.gnu.org.

GNU tar can uncompress and extract in a single-step:

tar -zxvf emacs-VERSION.tar.gz

At 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:

cd emacs-VERSION
./configure # configure Emacs for your particular system
make # use Makefile to build components, then Emacs

If the make completes successfully, the odds are fairly good that
the build has gone well. (See Problems building Emacs, if you weren't
successful.)

By default, Emacs is installed in /usr/local. To actually
install files, become the superuser and type

make install

Note that ‘make install’ will overwrite /usr/local/bin/emacs
and any Emacs Info files that might be in /usr/local/share/info/.