首頁 > 軟體

CentOS 7.6下原始碼安裝Emacs 26.3

2020-06-16 16:31:28

Emacs 26.3已經發布,現在可以使用Emacs文字編輯器的26.3版了。此版本主要是維護版本,其中包含GNU ELPA軟體包的新GPG金鑰。

下面詳細介紹如何在CentOS 7.6下原始碼安裝Emacs 26.3的全過程。

1、下載找到Emacs的最新版本

可在這裡檢視下載 http://gnu.mirrors.pair.com/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


IT145.com E-mail:sddin#qq.com