Fix the “sudo: command not found” Error on Linux
How to Fix the “sudo: command not found” Error on Linux
Run the following command to install Sudo command or tool in your Linux operating system:
If you are using Debian based operating systems like Ubuntu then run the following commands:
apt install sudo
Then, you need to add your user to the sudo group with the following command:
usermod -aG sudo yourusername
On Arch-based systems,:
Ezoic
pacman -S sudo
Then, run the following to add the user to the wheel group in your Linux:
usermod -aG wheel yourusername
On Fedora and other RHEL-based distros, run the following command to install sudo :
dnf install sudo
Then, run the following command to add your user to the sudo group:
usermod -aG wheel yourusername
Conclustion: Now you have successfully installed sudo and added your user to the sudo group. Try running again sudo command and i guess you won’t need to go through the error again