Emacs安装
# Install essential build tools
sudo apt-get install build-essential texinfo libx11-dev libxpm-dev libjpeg-dev libpng-dev libgif-dev libtiff-dev libgtk2.0-dev libncurses-dev gnutls-dev libgtk-3-dev git autoconf
# Clone source
git clone --depth=1 https://github.com/emacs-mirror/emacs.git
# Go to source
cd emacs/
# Build Emacs
./autogen.sh
./configure --with-mailutils
make
# Install (optional)
sudo make install
1.Ubuntu编译安装emacs
# 更新系统安装包
sudo apt update
sudo apt upgrade
# Insall Emacs source on Ubuntu 20.04 (gnome)
uname -a
# Linux maxUbuntu 5.11.0-27-generic #29~20.04.1-Ubuntu SMP Wed Aug 11 15:58:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
mkdir ~/src
cd ~/src
# 安装依赖
sudo apt-get install build-essential automake texinfo libjpeg-dev libncurses5-dev
sudo apt-get install libtiff5-dev libgif-dev libpng-dev libxpm-dev libgtk-3-dev libgnutls28-dev
# 下载emacs安装包
sudo apt-get install git
git clone -b master git://git.sv.gnu.org/emacs.git
cd emacs/
# read INSTALL.REPO
bash ./autogen.sh
# configure recommended I add --with-mailutils
./configure --with-mailutils --prefix="${HOME}/local"
make
# check it's working
src/emacs --version
# run GNU Emacs 27.2
src/emacs &
# install it globally
sudo make install
2.通过PPA存储库安装
# 将ppa存储库添加到Ubuntu系统
sudo add-apt-repository ppa:kelleyk/emacs
# 安装emacs
sudo apt update
sudo apt install emacs27
# 检查emacs
emacs --version
3.通过snap安装
sudo apt install snapd
sudo snap install emacs --classic
启动Emacs,然后查看版本:M-x emacs-version
或者在命令行中查看版本:emacs --version