How to Install vim on CentOS 6.2

Share this Article :

When i try to edit a file using vim instead of vi, the following error appeared. How to fix this?

    [[email protected] ~]# vim /etc/httpd/conf/httpd.conf
    -bash: vim: command not found


Simply run yum install command to install vim on CentOS 6.2. This steps has been tested on CentOS 6.2. Assume that you have installed minimal installation type CentOS 6.2 and has setup your own local yum repository. You can use internet CentOS yum repository instead if you have direct internet connection to your server.
How to Setup Local Yum Repository from CD-ROM/DVD-ROM image on CentOS 6.2

    [[email protected] ~]# yum install vim-enhanced
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base:
     * extras:
     * updates:
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package vim-enhanced.i686 2:7.2.411-1.6.el6 will be installed
    --> Processing Dependency: vim-common = 2:7.2.411-1.6.el6 for package: 2:vim-enhanced-7.2.411-1.6.el6.i686
    --> Processing Dependency: for package: 2:vim-enhanced-7.2.411-1.6.el6.i686
    --> Running transaction check
    ---> Package gpm-libs.i686 0:1.20.6-12.el6 will be installed
    ---> Package vim-common.i686 2:7.2.411-1.6.el6 will be installed
    --> Finished Dependency Resolution
    Dependencies Resolved
     Package             Arch        Version                   Repository                   Size
     vim-enhanced        i686        2:7.2.411-1.6.el6         CentOS6.2-Repository        839 k
    Installing for dependencies:
     gpm-libs            i686        1.20.6-12.el6             CentOS6.2-Repository         28 k
     vim-common          i686        2:7.2.411-1.6.el6         CentOS6.2-Repository        6.0 M
    Transaction Summary
    Install       3 Package(s)
    Total download size: 6.8 M
    Installed size: 19 M
    Is this ok [y/N]: y
    Downloading Packages:
    Total                                                        9.9 MB/s | 6.8 MB     00:00
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing : gpm-libs-1.20.6-12.el6.i686                                               1/3
      Installing : 2:vim-common-7.2.411-1.6.el6.i686                                         2/3
      Installing : 2:vim-enhanced-7.2.411-1.6.el6.i686                                       3/3
      vim-enhanced.i686 2:7.2.411-1.6.el6
    Dependency Installed:
      gpm-libs.i686 0:1.20.6-12.el6               vim-common.i686 2:7.2.411-1.6.el6

Leave a Reply