Next: Where can I get Emacs for macOS, MS Windows, etc?, Up: Compiling and installing Emacs [Contents][Index]
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:
https://ftp.gnu.org/pub/gnu/emacs/emacs-VERSION.tar.xz
(Replace ‘VERSION’ with the relevant version number, e.g., ‘28.1’.)
xz
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 -axvf emacs-VERSION.tar.xz
cd emacs-VERSION ./configure # configure Emacs for your particular system make # use Makefile to build components, then Emacs
If the make
completes successfully, you can go on to install it.
(See What should I do if I have trouble building Emacs?, if you weren’t successful.)
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/.