1.更新apt-get源:
这一步是建议要做的, 因为emacs的x-windows界面依赖很多新版本的图像库(如libgtk2.0), 如果你的源比较旧,这些库是没办法更新的, 至少我遇到了这个问题...
将以下配置覆盖到/etc/apt/sources.list ,重新执行 sudo apt-get update即可:
deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse ##測試版源 deb http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse # 源碼 deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse ##測試版源 deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
trusty是14.04版本代号, 其他版本代码如下:
18.04 bionic
17.10 artful
16.04 xenial
14.04 trusty
2. 安装依赖的库
sudo apt-get install libgtk2.0-dev sudo apt-get install libxpm-dev sudo apt-get install libjpeg62-dev sudo apt-get install libgif-dev sudo apt-get install libtiff5-dev sudo apt-get install libncurses5-dev sudo apt-get install libcanberra*
3.源码安装:
下载连接: http://mirrors.ustc.edu.cn/gnu/emacs/
编译安装 (如果不需要x-windows界面, 可以携带参数 --without-x)
./configure
make
sudo make install