小编给大家分享一下centos安装vim失败怎么办,希望大家阅读完这篇文章后大所收获,下面让我们一起去探讨吧!

centos安装vim失败解决方法:

在线安装vim: yum install vim

今天我在用CentOS 5.5的yum命令安装的时候出现如下错误:

[root@malu2~]#yuminstallvimLoadedplugins:fastestmirrorLoadingmirrorspeedsfromcachedhostfile*base:mirror.hosting90.cz*extras:mirror.hosting90.cz*updates:mirror.hosting90.czSettingupInstallProcessNopackagevimavailable.Nothingtodo

解决办法:

更新一下yum仓库:

#yum-yupdate

再次运行安装,发现错误依旧,看来这种猜包名的方法不适用;所以接下来可以通过yum的查找参数来列出vim相关的包名:

[root@malu2yum.repos.d]#yumsearchvimLoadedplugins:fastestmirrorLoadingmirrorspeedsfromcachedhostfile*base:mirror.hosting90.cz*extras:mirror.hosting90.cz*updates:mirror.hosting90.cz=====================Matched:vim===================vim-X11.x86_64:TheVIMversionofthevieditorfortheXWindowSystem.vim-common.x86_64:ThecommonfilesneededbyanyversionoftheVIMeditor.vim-enhanced.x86_64:AversionoftheVIMeditorwhichincludesrecent:enhancements.vim-minimal.x86_64:AminimalversionoftheVIMeditor.

通过查看,我们可以看到,yum列出了详细的vim相关的包名,这样就可以顺利的安装vim了:

#yum-yinstallvim-enhanced.x86_64

看完了这篇文章,相信你对centos安装vim失败怎么办有了一定的了解,想了解更多相关知识,欢迎关注亿速云行业资讯频道,感谢各位的阅读!