Skip to content

Instantly share code, notes, and snippets.

@WenxiJin
Last active June 28, 2017 13:44
Show Gist options
  • Save WenxiJin/c2c46522b927911d4a199014ce912501 to your computer and use it in GitHub Desktop.
Save WenxiJin/c2c46522b927911d4a199014ce912501 to your computer and use it in GitHub Desktop.
Script for installing emacs 25.1
#!/usr/bin/env sh
# Exit on error
set -x
# Take around 10 mins to finish. 8 i7 core, 8 GB ram
# Ubuntu 16: enable apt source, or you can do this by ticking "source code" in "Ubuntu Software"
sudo su -c "grep '^deb ' /etc/apt/sources.list | \
sed 's/^deb/deb-src/g' > /etc/apt/sources.list.d/deb-src.list"
sudo apt-get install -y build-essential
# postfix will prompt for mail configurations
sudo apt-get build-dep -y emacs24
# without prompt
# sudo apt-get install -y libgtk2.0-dev
# sudo apt-get install -y libxpm-dev libjpeg-dev libgif-dev libtiff4-dev
# sudo apt-get install -y libncurses-dev
rm -f emacs-25.1.tar.xz
wget http://ftp.gnu.org/gnu/emacs/emacs-25.1.tar.xz
tar -xf emacs-25.1.tar.xz && cd emacs-25.1
./configure
# ./configure --with-x-toolkit=no
make
sudo make install
sudo touch /usr/share/applications/Emacs-25.1.desktop
sudo echo <<EOF > /usr/share/applications/Emacs-25.1.desktop
[Desktop Entry]
Version=1.0
Name=Emacs-25.1
Exec=env UBUNTU_MENUPROXY=0 /usr/local/bin/emacs
Terminal=false
Icon=emacs
Type=Application
Categories=IDE
X-Ayatana-Desktop-Shortcuts=NewWindow
[NewWindow Shortcut Group]
Name=New Window
TargetEnvironment=Unity
EOF
sudo ln -sfn /usr/local/bin/emacs-25.1 /usr/local/bin/emacs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment