Skip to content

Instantly share code, notes, and snippets.

@lzhoucs
Last active October 23, 2016 01:19
Show Gist options
  • Save lzhoucs/a8991997c7abb55a429768c569cf4d5e to your computer and use it in GitHub Desktop.
Save lzhoucs/a8991997c7abb55a429768c569cf4d5e to your computer and use it in GitHub Desktop.
build emacs from github repo or source package

Install

  1. uncomment deb-src
sudo vi /etc/apt/sources.list
  1. update
sudo apt-get update
  1. install dependencies
sudo apt-get build-dep emacs24
  1. prepare source (choose one from the following)
  • download source package
wget http://ftp.gnu.org/gnu/emacs/emacs-24.5.tar.xz
tar -xf emacs-24.5.tar.xz
  • clone github repo
git clone [email protected]:emacs-mirror/emacs.git
git checkout emacs-25   # master is not as stable
./autogen.sh
  1. ./configure --prefix=/usr

Without --prefix=/usr, the default prefix goes to /usr/local, and emacs will be installed to /usr/local/bin instead of usr/bin. Use ./configure --help to check for other options.

  1. make

  2. sudo make install

  3. clean up after install

make distclean

Uninstall

sudo make uninstall. Note this will perform an uninstall based on the current configuration generated by ./configure. So if we are trying to remove an emacs installed to /usr/bin, make sure the current configuration is generated from ./configure --prefix=/usr

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment