For some reason, if you see the following error on Ubuntu, Arch Linux or Debian, then here's the easy fix for it.
[jer@jer~]$ sudo visudo
visudo: no editor found (editor path = /usr/bin/vi)
There are two reasons for it.
Visudo is a Linux CLI utility used to edit the sudoers file safely. The sudoers file is a configuration file that controls who can run commands on the Linux system with sudo privileges.
Here are some of the reasons why you should use visudo:
apt install sudoon Ubuntu and Debian. And run
pacman -S sudoon Arch Linux.
nanoinstead of Vim or Vi then run visudo like this as root user:
In case you don't have nano either, then you can install it first and then try running the visudo.
pacman -S nano on Arch Linux,
apt install nano on Ubuntu and Debian.
pacman -S vi on Arch Linux,
apt install vi on Ubuntu and Debian.
visudo is an important utility on Linux operating system to change the behavior of the system users. I usually use it to remove sudo password and I once got into this error and I had to look for solution. I found the solution so I thought I must share it with others.