![[Home]](https://www.emacswiki.org/images/logo218x38.png)
The official and detailed directions on building Emacs can be found in the INSTALL and INSTALL.REPO files distributed with Emacs.
Because these instructions have been repeated so many times on this wiki, a brief summary of the basic steps is provided here. Nevertheless you should really also read the official documentation. We won’t repeat everything said there just for the sake of it.
First, visit Emacs' Download page. Get the latest release (tarball), unpack it and run:
$ sudo apt install build-essential # for Ubuntu 20.04
$ sudo apt build-dep emacs # for Ubuntu 20.04
$ cd /where/you/unpacked/emacs
$ mkdir build && cd build
$ ../configure
$ make -jX # use -jX if compiling with X cores
$ sudo make -jX install # use -jX if compiling with X coresMore information on obtaining the development sources can be found at EmacsDevelopmentSources.
CategoryBuilding contains links to dedicated pages explaining how Emacs can be installed on various platforms. These pages provide instructions on how to use your distributions / platforms package manager to install Emacs and additional packages; and/or tell you how to obtain snapshots of the development sources.
Here is how to install Emacs using stow:
$ ./configure
$ make
$ make install prefix=/usr/local/stow/emacs
$ cd /usr/local/stow
$ stow emacsIf you have several installations of Emacs and XEmacs, perhaps some Gnus installation on side as well, then stow will detect conflicts in the info subdirectories. In order to resolve these, you must delete the appropriate info files. Example: You have Emacs and a separate Gnus installation. Then you need to delete the Gnus specific info files from /usr/local/stow/emacs/info. What I usually do is run stow emacs, delete the offending file, and repeat until all offending files have been deleted.
You must have some of the Xlib libraries available, even when you do not use X. On Debian, this is the xlibs-devel package.
For a fully featured Emacs, you need the following libraries (on a single line for use in commands):
libc6-dev libjpeg62-dev libncurses5-dev libpng-dev libtiff4-dev libungif4-dev xaw3dg-dev zlib1g-dev libice-dev libsm-dev libx11-dev libxext-dev libxi-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxt-dev libxtrap-dev libxtst-dev libxv-dev x-dev xlibs-static-dev
On Debian Woody (thanks to MilesBader) that list should be:
libc6-dev libjpeg62-dev libncurses5-dev libpng-dev libtiff3g-dev libungif4-dev xaw3dg-dev zlib1g-dev xlibs-dev
On Debian Buster that list should be:
libc6-dev libjpeg62-turbo libncurses5-dev libpng-dev libtiff5-dev libgif-dev xaw3dg-dev zlib1g-dev libx11-dev
For an improved X11 experience, install the following dependencies on your system.
Fedora 20: glibc-devel libjpeg-turbo ncurses-libs libpng-devel libtiff-devel giflib-devel Xaw3d-devel zlib-devel ice-devel libSM-devel libX11-devel libXext-devel libXi-devel libXmu-devel libXpm-devel libXrandr-devel libXt-devel libXtst-devel libXv-devel libX11-devel
missing/unresolved libraries: libxtrap-dev x-dev xlibs-static-dev
Ubuntu 20.04: libgtk-3-dev libwebkit2gtk-4.0-dev
And then, configure with:
./configure --with-cairo --with-xwidgets --with-x-toolkit=gtk3
Source: StackExchange: Compiling Emacs 25.1 on Ubuntu 16.04