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 sudo
on Ubuntu and Debian. And run pacman -S sudo
on Arch Linux.nano
instead of Vim or Vi then run visudo like this as root user: EDITOR=nano visudo
In case you don't have nano either, then you can install it first and then try running the visudo.
Installing nano: pacman -S nano
on Arch Linux, apt install nano
on Ubuntu and Debian.
Installing Vi: 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.