CentOS5.5编译安装gvim7.3 失败记录
现在Vim的最新版本是v7.3,而CentOS最新只能更新到v7.2,所以想自己编译安装一下试试,顺便安装gvim,不过最后gvim还是安装失败了。不知道为什么,先记录一下,后面再摸索摸索吧:
1、下载vim源代码
vim的官方网站是:www.vmunix.com/vim
可以用这个链接下载源码包:ftp://ftp.jp.vim.org/pub/vim/unix/vim-7.0.tar.bz2
2、解压
将 /usr/src/vim-7.3.tar.bz2 文件解压缩在 /usr/local 底下
可以用这个链接下载源码包:ftp://ftp.jp.vim.org/pub/vim/unix/vim-7.0.tar.bz2
2、解压
将 /usr/src/vim-7.3.tar.bz2 文件解压缩在 /usr/local 底下
cd /usr/local tar -xvf /usr/src/vim-7.3.tar.bz2
3、配置
./configure --prefix=/usr/local/vim73 --with-x --enable-gui=gtk2 --with-features=big --disable-selinux --enable-multibyte
- 这里如果没有“--disable selinux”configure的时候会报错:
os_unix.c:45:30: 错误:selinux/selinux.h:没有那个文件或目录
os_unix.c: In function ‘mch_copy_sec’:
os_unix.c:2667: 警告:隐式声明函数 ‘is_selinux_enabled’
os_unix.c:2671: 错误:‘security_context_t’ 未声明 (在此函数内第一次使用)
os_unix.c:2671: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
os_unix.c:2671: 错误:所在的函数内只报告一次。)
os_unix.c:2671: 错误:expected ‘;’ before ‘from_context’
os_unix.c:2672: 错误:expected ‘;’ before ‘to_context’
os_unix.c:2674: 警告:隐式声明函数 ‘getfilecon’
os_unix.c:2674: 错误:‘from_context’ 未声明 (在此函数内第一次使用)
os_unix.c:2687: 错误:‘to_context’ 未声明 (在此函数内第一次使用)
os_unix.c:2692: 警告:隐式声明函数 ‘freecon’
os_unix.c:2697: 警告:隐式声明函数 ‘setfilecon’
make[2]: *** [objects/os_unix.o] 错误 1
make[2]: Leaving directory `/opt/bzip2/vim73/src'
make[1]: *** [myself] 错误 2
make[1]: Leaving directory `/opt/bzip2/vim73/src'
make: *** [first] 错误 2
os_unix.c: In function ‘mch_copy_sec’:
os_unix.c:2667: 警告:隐式声明函数 ‘is_selinux_enabled’
os_unix.c:2671: 错误:‘security_context_t’ 未声明 (在此函数内第一次使用)
os_unix.c:2671: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
os_unix.c:2671: 错误:所在的函数内只报告一次。)
os_unix.c:2671: 错误:expected ‘;’ before ‘from_context’
os_unix.c:2672: 错误:expected ‘;’ before ‘to_context’
os_unix.c:2674: 警告:隐式声明函数 ‘getfilecon’
os_unix.c:2674: 错误:‘from_context’ 未声明 (在此函数内第一次使用)
os_unix.c:2687: 错误:‘to_context’ 未声明 (在此函数内第一次使用)
os_unix.c:2692: 警告:隐式声明函数 ‘freecon’
os_unix.c:2697: 警告:隐式声明函数 ‘setfilecon’
make[2]: *** [objects/os_unix.o] 错误 1
make[2]: Leaving directory `/opt/bzip2/vim73/src'
make[1]: *** [myself] 错误 2
make[1]: Leaving directory `/opt/bzip2/vim73/src'
make: *** [first] 错误 2
- 如果没有安装ncurses这个库,configure的时候还是会报错:
checking for tgetent in -lncurses... no
checking for tgetent in -ltermlib... no
checking for tgetent in -ltermcap... no
checking for tgetent in -lcurses... no
no terminal library found
checking for tgetent()... configure: error: NOT FOUND!
You need to install a terminal library; for example ncurses.
Or specify the name of the library with --with-tlib.
checking for tgetent in -ltermlib... no
checking for tgetent in -ltermcap... no
checking for tgetent in -lcurses... no
no terminal library found
checking for tgetent()... configure: error: NOT FOUND!
You need to install a terminal library; for example ncurses.
Or specify the name of the library with --with-tlib.
安装ncurses
yum install ncurses-devel
安装ncurses后重新configure:
/configure --prefix=/usr/local/vim73 --with-x --enable-gui=gtk2 --with-features=big --disable-selinux --enable-multibyte
4、make/make install
接下来执行: make && make install 。现在你的Vim7.3就在 /usr/local/了 O(∩_∩)O~
5、建立链接
mv /usr/bin/vim /usr/bin/vim_backup # 先将原来的备份 ln -s /usr/local/vim73/bin/vim /usr/bin/vim # 再将vim 7.3链接过来
6、运行
当运行vim的时候,显示已经升级到最新版的7.3了
但是在执行gvim命令的时候,提示:
[root@localhost ~]# gvim
bash: /usr/bin/gvim: 没有那个文件或目录
是不是没有建立链接,
ln -s /usr/local/vim73/bin/gvim /usr/bin/gvim 还是不行
到/usr/local/vim73/bin/一看,根本没有gvim,真是不明白为什么。我的配置过程中明明加了--enable-gui=gtk2,过程中似乎没有什么提示啊。敬请高手指点!
最后还是装了老的版本:
yum install vim-X11
分类:
linux
标签:
centOS gvim7.3
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· 展开说说关于C#中ORM框架的用法!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?