How to Solve Error Message vim: command not found in Linux CentOS 8

Posted on


This article is informing about how to solve an error message appear upon executing a certain command. That command is the execution of a command or a tool with the name of ‘vim’. Actually, vim is a text editor available in Linux/Unix operating system. According to the manual page of the command, it is a Vi IMproved, a programmer’s text editor. So, it is an improved version of vi which is a programmer’s text editor. So, the solution is simple. Just install the package or the program with the name of ‘vim’. The following is the error display upon the execution of the program :

[root@10 nodejs]# vim demo_server.js
-bash: vim: command not found
[root@10 nodejs]#

Error Message Solution by Installing the ‘vim’ Package

Installing package in Linux operating system is simple. The following is the installation of the program using the default package manager tool of Linux CentOS 8 :

[root@10 nodejs]# yum -y install vim
Last metadata expiration check: 0:05:54 ago on Thu 04 Feb 2021 12:50:22 PM EST.
Dependencies resolved.
 Package                                                    Architecture                                       Version                                                          Repository                                             Size
 vim-enhanced                                               x86_64                                             2:8.0.1763-15.el8                                                AppStream                                             1.4 M
Installing dependencies:
 gpm-libs                                                   x86_64                                             1.20.7-15.el8                                                    AppStream                                              39 k
 vim-common                                                 x86_64                                             2:8.0.1763-15.el8                                                AppStream                                             6.3 M
 vim-filesystem                                             noarch                                             2:8.0.1763-15.el8                                                AppStream                                              48 k

Transaction Summary
Install  4 Packages

Total download size: 7.8 M
Installed size: 30 M
Downloading Packages:
(1/4): gpm-libs-1.20.7-15.el8.x86_64.rpm                                                                                                                                                                     56 kB/s |  39 kB     00:00
(2/4): vim-filesystem-8.0.1763-15.el8.noarch.rpm                                                                                                                                                            210 kB/s |  48 kB     00:00
(3/4): vim-enhanced-8.0.1763-15.el8.x86_64.rpm                                                                                                                                                              488 kB/s | 1.4 MB     00:02
(4/4): vim-common-8.0.1763-15.el8.x86_64.rpm                                                                                                                                                                927 kB/s | 6.3 MB     00:07
Total                                                                                                                                                                                                       1.0 MB/s | 7.8 MB     00:07
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                    1/1
  Installing       : vim-filesystem-2:8.0.1763-15.el8.noarch                                                                                                                                                                            1/4
  Installing       : vim-common-2:8.0.1763-15.el8.x86_64                                                                                                                                                                                2/4
  Installing       : gpm-libs-1.20.7-15.el8.x86_64                                                                                                                                                                                      3/4
  Running scriptlet: gpm-libs-1.20.7-15.el8.x86_64                                                                                                                                                                                      3/4
  Installing       : vim-enhanced-2:8.0.1763-15.el8.x86_64                                                                                                                                                                              4/4
  Running scriptlet: vim-enhanced-2:8.0.1763-15.el8.x86_64                                                                                                                                                                              4/4
  Running scriptlet: vim-common-2:8.0.1763-15.el8.x86_64                                                                                                                                                                                4/4
  Verifying        : gpm-libs-1.20.7-15.el8.x86_64                                                                                                                                                                                      1/4
  Verifying        : vim-common-2:8.0.1763-15.el8.x86_64                                                                                                                                                                                2/4
  Verifying        : vim-enhanced-2:8.0.1763-15.el8.x86_64                                                                                                                                                                              3/4
  Verifying        : vim-filesystem-2:8.0.1763-15.el8.noarch                                                                                                                                                                            4/4

  gpm-libs-1.20.7-15.el8.x86_64                       vim-common-2:8.0.1763-15.el8.x86_64                       vim-enhanced-2:8.0.1763-15.el8.x86_64                       vim-filesystem-2:8.0.1763-15.el8.noarch

[root@10 nodejs]#

Use the ‘yum’ package manager tool to install the program with the name of ‘vim’. So, after installing the ‘vim’ package, just try to execute the program again. If there are no other obstacles, the execution of the command will be just fine.

Leave a Reply