CentOS 編譯安裝 Emacs 並配置

Linux 中 CentOS 系列一貫以穩定爲目標,然而也會存在版本太舊的問題,Emacs 就是其中的一個,目前 Emacs 都發行到 25.2 了,而 CentOS 上的 Emacs 版本卻仍是 23.1。因此須要下載源代碼進行編譯安裝。html

  • 1.下載源代碼並解壓:
sh-4.1$ wget http://mirrors.ustc.edu.cn/gnu/emacs/emacs-25.1.tar.gz 
    sh-4.1$ tar -xvf ~/emacs-25.1.tar.gz

具體下載狀況請參考 GNU Emacslinux

  • 2.安裝依賴庫:
sh-4.1$ sudo yum install gcc* glib* gtk* ncurses* libXpm* giflib* libjpeg* libtiff* libpng* -y
  • 3.編譯連接:
sh-4.1$ mkdir -p emacs-build      ## 防止污染源代碼
    sh-4.1$ cd emacs-build/
    sh-4.1$ sudo ../emacs-25.1/configure
    sh-4.1$ sudo make && sudo make install
  • 4.查看結果:
sh-4.1$ emacs --version

就能夠看到以下圖所示結果:

至此,Emacs 就安裝完成了。而後就能夠使用 Emacs 的插件和配置了。ui

相關文章
相關標籤/搜索