How to Fix the “sudo: command not found” Error on Linux How to Fix the “sudo: command not found” Error on Linux

How to Fix the “sudo: command not found” Error on Linux

Fix the “sudo: command not found” Error on Linux

The Command su, stands for “super user,” “substitute user,”  or “switch user,” and sudo stands for either “substitute user do” or “super user do”. Sudo allows you to log in as root and do whatever you want with the system or in anothr word, sudo promotes your current user account with root privileges. sudo is installed by default in most of the Linux. If your Linux is not having sudo by default then you might come across the error like sudo command not found.
What is the solution for  the “sudo: command not found” Error on Linux?
Simple solution is to install sudo command tool.

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

Leave a Reply

Your email address will not be published. Required fields are marked *