vim

How to Fix “Vim Command Not Found” Error in Ubuntu

Undoubtedly, Linux is a bit tricky operating system to use. Many people switch from proprietary operating systems like Windows and macOS to Linux distributions because of their stability, performance, security, and open-source nature. But at the same time, many beginners find it challenging to use because of its Command Line Interface (CLI).

CLI is a bit intimidating, but as you get to know it, you will be amazed at the benefits it offers and even find it extremely easy to use compared to GUI-based environments. Through terminal, you can do just about anything you want. For example, you can manage files, edit files, download any package, run a program, view images, and even play videos.

Terminal is a very important program and available in all operating systems. There are various tasks that can only be done in terminal. Many beginners get annoyed when terminal gives them errors while performing some tasks. One of those errors is the “Command ‘vim’ not found” error, which you usually encounter when you copy commands from an online source. This write-up is all about guiding you on how to fix this error. So, let’s begin.

How to Fix the “vim command not found” Error in Ubuntu 20.04 and 20.10:

While using Linux, you often run into errors like “command not found”. It is usually because that command is not the default command of Linux and requires an additional program to install.

For example, while executing the following command, I am getting “Command ‘vim’ not found”, error:

$ vim my_config.txt


You came across this error because “vim” is not one of the default commands of Ubuntu, and you do not have the “vim” utility installed in your system. Terminal gives suggestions to download “vim” with commands. To solve this problem, execute the below-mentioned command:

$ sudo apt install vim


The above command will install Vim utility into your system. Vim is an open-source, powerful text and source code editor that offers many features including syntax highlighting of scripts, support of plugins, and it even comes with a graphical user interface (gvim).

After installing the Vim editor, any command with “vim” will work. Now open the “my_config.txt” using the “vim” command:


The file has opened successfully.

Conclusion:

Learning terminal is one of the primary objectives of every new Linux user. Though the graphical environment has reduced the dependency on terminal, many tasks still require terminal, and many users find terminal pretty quick and easy to use.

However, as a beginner, you have to confront many errors while using Linux. Therefore, we explained how to eliminate the “Command ‘vim’ not found” error in this guide. Vim is a text editor which does not come preinstalled in Linux, so you need to get this utility to use the “vim” command.

About the author

Sam U

I am a professional graphics designer with over 6 years of experience. Currently doing research in virtual reality, augmented reality and mixed reality.
I hardly watch movies but love to read tech related books and articles.