下面详细介绍如何在CentOS 7.6下源码安装Emacs 26.3的全过程。
1、下载找到Emacs的最新版本
找对最新的版本,在此我下载的是emacs-26.3.tar.xz版本。
2. 下载
可直接复制链接用wget [链接] 来下载
wget https://mirrors.sjtug.sjtu.edu.cn/gnu/emacs/emacs-26.3.tar.xz
xz -d emacs-26.3.tar.xz # 解压
tar -xvf emacs-26.3.tar
cd emacs-26.3.tar.xz # 进入安装目录
3. 安装前配置
[linuxidc@localhost emacs-26.3]$ ./configure
由于没有相关依赖,有如下错误:
......
checking for libXaw... configure: error: No X toolkit could be found.
If you are sure you want Emacs compiled without an X toolkit, pass
--with-x-toolkit=no
to configure. Otherwise, install the development libraries for the toolkit
that you want to use (e.g. Gtk+) and re-run configure.
......
[linuxidc@localhost emacs-26.3]$ ./configure --with-x-toolkit=no
添加参数重新配置
......
checking gif_lib.h usability... no
checking gif_lib.h presence... no
checking for gif_lib.h... no
configure: error: The following required libraries were not found:
libXpm libgif/libungif gnutls
Maybe some development libraries/packages are missing?
If you don't want to link with them give
--with-xpm=no --with-gif=no --with-gnutls=no
as options to configure
......
取消相关link。
[linuxidc@localhost emacs-26.3]$ ./configure --with-x-toolkit=no --with-gif=no --with-tiff=no --with-gnutls=no
再次提示:
......
configure: error: The following required libraries were not found:
libXpm
Maybe some development libraries/packages are missing?
If you don't want to link with them give
--with-xpm=no
as options to configure
......
安装 libXpm
[linuxidc@localhost emacs-26.3]$ sudo yum install -y libXpm-devel
然后再次
[linuxidc@localhost emacs-26.3]$ ./configure --with-x-toolkit=no --with-gif=no --with-tiff=no --with-gnutls=no
4. 安装
[linuxidc@localhost emacs-26.3]$ make
[linuxidc@localhost emacs-26.3]$ sudo make install
5. 安装后配置
进入home目录。
# cd
# git clone https://github.com/combofish/emacs.d
# mv emacs.d .emacs.d
# emacs -nw
等待emacs加载完成就可以爽敲代码了。
Emacs 26.3 发布,附带GPG密钥用于GNU ELPA包签名检查 https://www.linuxidc.com/Linux/2019-09/160450.htm
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx