按照好centos 6.9 的机器后发现系统自带的emacs版本是23 ,心里不爽,于是干掉
[root@centos ~]# rpm -qa | grep emacs
emacs-23.1-28.el6.x86_64
emacs-common-23.1-28.el6.x86_64
[root@centos ~]# rpm -e emacs
发现yum 安装之后的依然是23版本,只好源码编译,打开emacs的镜像下载地址,里面各种版本应有尽有
http://mirror.rit.edu/gnu/emacs/
emacs-24.1.tar.gz 2012-Jun-10 04:10:01 49.0M application/x-tgz
emacs-24.1.tar.gz.sig 2012-Jun-10 04:10:03 0.1K application/pgp-signature
emacs-24.2.tar.bz2 2012-Aug-27 02:19:01 39.8M application/x-bzip-compressed-tar
emacs-24.2.tar.bz2.sig 2012-Aug-27 02:19:03 0.1K application/pgp-signature
emacs-24.2.tar.gz 2012-Aug-27 02:53:48 49.0M application/x-tgz
emacs-24.2.tar.gz.sig 2012-Aug-27 02:53:50 0.1K application/pgp-signature
emacs-24.2.tar.xz 2012-Aug-27 02:38:51 33.1M application/octet-stream
emacs-24.2.tar.xz.sig 2012-Aug-27 02:38:53 0.1K application/pgp-signature
emacs-24.3.tar.gz 2013-Mar-10 22:31:50 50.1M application/x-tgz
emacs-24.3.tar.gz.sig 2013-Mar-10 22:31:51 0.4K application/pgp-signature
emacs-24.3.tar.xz 2013-Mar-10 22:15:35 33.9M application/octet-stream
emacs-24.3.tar.xz.sig 2013-Mar-10 22:15:35 0.4K application/pgp-signature
emacs-24.4.tar.gz 2014-Oct-20 15:06:54 56.2M application/x-tgz
emacs-24.4.tar.gz.sig 2014-Oct-20 15:06:55 0.4K application/pgp-signature
emacs-24.4.tar.xz 2014-Oct-20 15:01:56 37.9M application/octet-stream
emacs-24.4.tar.xz.sig 2014-Oct-20 15:01:57 0.4K application/pgp-signature
emacs-24.5.tar.gz 2015-Apr-10 12:59:54 56.4M application/x-tgz
emacs-24.5.tar.gz.sig 2015-Apr-10 12:59:55 0.5K application/pgp-signature
emacs-24.5.tar.xz 2015-Apr-10 12:58:13 37.9M application/octet-stream
emacs-24.5.tar.xz.sig 2015-Apr-10 12:58:14 0.5K application/pgp-signature
emacs-25.1.tar.gz 2016-Sep-17 13:08:20 59.4M application/x-tgz
emacs-25.1.tar.gz.sig 2016-Sep-17 13:08:21 0.4K application/pgp-signature
emacs-25.1.tar.xz 2016-Sep-17 13:09:41 40.5M application/octet-stream
emacs-25.1.tar.xz.sig 2016-Sep-17 13:09:42 0.4K application/pgp-signature
emacs-25.2.tar.gz 2017-Apr-21 11:35:36 61.3M application/x-tgz
emacs-25.2.tar.gz.sig 2017-Apr-21 11:35:37 0.4K application/pgp-signature
emacs-25.2.tar.xz 2017-Apr-21 11:36:58 44.7M application/octet-stream
emacs-25.2.tar.xz.sig 2017-Apr-21 11:36:58 0.4K application/pgp-signature
emacs-25.3.tar.gz 2017-Sep-11 15:54:44 60.0M application/x-tgz
emacs-25.3.tar.gz.sig 2017-Sep-11 15:54:44 0.4K application/pgp-signature
emacs-25.3.tar.xz 2017-Sep-11 16:45:18 40.8M application/octet-stream
emacs-25.3.tar.xz.sig 2017-Sep-11 16:45:19 0.4K application/pgp-signature
emacs-lisp-intro-2.04.tar.gz 2001-Dec-17 14:36:40 487.8K application/x-tgz
emacs-lisp-intro-README-2nd-edition 2001-Dec-17 13:33:22 5.5K application/octet-stream
下载自己想要的版本,网页里面点右键复制下载链接,然后
[root@centos ~]# wget http://mirror.rit.edu/gnu/emacs/emacs-24.5.tar.gz
安装之前,先安装各种必备的工具
yum install gcc* glib* gtk* ncurses* libXpm* giflib* libjpeg* libtiff* libpng* -y
解压缩
[root@centos ~]# tar -zxvf emacs-24.5.tar.gz
安装
[root@centos emacs-24.5]# ./configure
[root@centos emacs-24.5]# make && make install
GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23)
of 2018-01-06 on centos
Copyright (C) 2015 Free Software Foundation, Inc.
大功告成
收工
其他:
源码安装 Emacs 24.5 的步骤如下:
1 安装需要的软件
复制代码
$ su
yum -y groupinstall "Development Tools"
yum -y install gtk+-devel gtk2-devel
yum -y install libXpm-devel
yum -y install libpng-devel
yum -y install giflib-devel
yum -y install libtiff-devel libjpeg-devel
yum -y install ncurses-devel
yum -y install gpm-devel dbus-devel dbus-glib-devel dbus-python
yum -y install GConf2-devel pkgconfig
复制代码
2 安装Emacs 24.5
复制代码
tar xvf emacs-24.5.tar.gz
cd emacs-24.5
sudo ./configure --prefix=/usr/local --with-x-toolkit=gtk --without-gsettings
sudo make
src/emacs -Q # 用来测试Emacs是否正常。如果能显示Emacs样例程序,则表示一切正常。
sudo make install
sudo make clean # 用来清除make产生的中间文件,释放空间(强迫症患者的必要步骤)
复制代码
3 卸载 Emacs 24.5
很简单,跳转到安装时的目录下,用一句命令即可:
tar xvf emacs-24.5.tar.gz
cd emacs-24.5 sudo ./configure --prefix=/usr/local --with-x-toolkit=gtk --without-gsettings
sudo make
sudo make uninstall # 用来卸载Emacs。之前安装时的命令为 install
如果安装前的编译文件被删除了,则重复一遍解压及编译命令即可。
转载于:https://blog.51cto.com/652465/2058279