(本文转载自 http://blog.sina.com.cn/s/blog_9a7260a60102vjje.html)
I>卸载VIM7.2老版本:
查看是否安装:
[root@localhost ~]# rpm -qa| grep vim
vim-minimal-7.2.411-1.8.el6.x86_64
vim-common-7.2.411-1.8.el6.x86_64
vim-enhanced-7.2.411-1.8.el6.x86_64
[root@localhost ~]# rpm -e vim-minimal-7.2.411-1.8.el6.x86_64 vim-enhanced-7.2.411-1.8.el6.x86_64 vim-common-7.2.411-1.8.el6.x86_64 --nodeps
[root@localhost ~]# rpm -aq|grep vim
注:--nodeps 选项是去掉依赖卸载,不加会报:vim-minimal is needed by (installed) sudo-1.8.6p3-15.el6.x86_64 之类的错。
II> 编译安装VIM 7.4
一、下载
[root@localhost src]# wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
[root@localhost src]# wget ftp://ftp.vim.org/pub/vim/extra/vim-7.2-extra.tar.gz
[root@localhost src]# wget ftp://ftp.vim.org/pub/vim/extra/vim-7.2-lang.tar.gz
二、解压缩
[root@localhost src]# tar jxvf vim-7.4.tar.bz2
[root@localhost src]# tar zxvf vim-7.2-extra.tar.gz
[root@localhost src]# tar zxvf vim-7.2-lang.tar.gz
[root@localhost src]# mv vim72 vim74
三、安装依赖库
[root@localhost src]# yum install ncurses-devel -y
四、配置confure文件
[root@localhost src]# cd vim74/src
[root@localhost src]# ./configure --with-features=huge --enable-rubyinterp --enable-pythoninterp --enable-luainterp --enable-multibyte --enable-sniff --enable-fontset --enable-cscope --enable-gui=auto --prefix=/usr --enable-xsmp --enable-xim --enable-gpm
五、编译
[root@localhost src]# make
六、测试编译结果
[root@localhost src]# make test
七、安装
[root@localhost src]# make install
八、测试是否升级成功
[root@localhost src]# vim --version
[root@localhost src]# yum install vim-X11 -y
十、检查是否安装成功
[root@localhost src]# rpm -qa |grep vim
vim-common-7.2.411-1.8.el6.x86_64
vim-X11-7.2.411-1.8.el6.x86_64