HomeLinuxcommand not discovered" Error on Linux

command not discovered” Error on Linux


Have you ever ever tried to run a Linux command utilizing sudo solely to see the warning “sudo command not discovered” splashed in your terminal? This may be fairly irritating and it prevents you from working in your system as a non-root person whereas performing administrative duties.

On this information, we have a look at how you can repair the “sudo command not discovered” error in Linux.

$ sudo apt set up apache2

-bash: sudo: command not discovered

What Is Sudo Command in Linux?

Sudo, an abbreviation for superuser do, is a program that permits customers to run instructions or packages with root or elevated privileges. Normally, utilizing sudo is the really helpful option to run a Linux system as an alternative of utilizing the foundation person. This mitigates the chance of breaking the system in case a probably harmful command is executed.

The sudo package deal ships by default in most Linux distributions, and you shouldn’t have an issue utilizing it. Nonetheless, this doesn’t all the time apply to all Linux distributions. There are explicit instances the place the system doesn’t include sudo put in. That is very true for older Debian programs akin to Debian 10 and later.

The “sudo command not discovered” error is nothing to be apprehensive about and in case you might have encountered this error, fear not. You may tackle it in a number of easy steps.

The right way to Repair “sudo command not discovered” in Linux

To repair this error, log into your system as the foundation person or just change to the foundation person.

$ sudo su -

Subsequent, replace the package deal lists and set up the sudo package deal as follows.

# apt replace -y
# apt set up sudo -y
Install Sudo in Debian-based Systems
Set up Sudo in Debian-based Programs

In case you are operating an RHEL-based distribution akin to CentOS Stream, Fedora or Rocky/Alma Linux change to the foundation person.

# su -

Then set up sudo utilizing the yum command as proven.

# yum set up sudo

For Arch Linux, run the command.

# pacman -Sy sudo

Add Person to Sudo Group in Linux

From right here, you’ll be able to add customers to the sudo group. For instance, so as to add person tecmint to the sudo group, run the command.

# usermod -aG sudo tecmint

To verify that the person has been added to the group, run:

# teams tecmint
Add User to Sudo Group
Add Person to Sudo Group

From right here, you’ll be able to comfortably run instructions utilizing sudo with out a problem in any respect.

# su tecmint
$ whoami
$ sudo apt set up apache2
Run Sudo Command in Linux
Run Sudo Command in Linux

On this information, we now have demonstrated how you can resolve the “sudo command not discovered” error in Linux. Your feedback and suggestions are welcome.

If You Recognize What We Do Right here On TecMint, You Ought to Contemplate:

TecMint is the quickest rising and most trusted neighborhood website for any type of Linux Articles, Guides and Books on the internet. Tens of millions of individuals go to TecMint! to look or browse the 1000’s of revealed articles accessible FREELY to all.

When you like what you’re studying, please take into account shopping for us a espresso ( or 2 ) as a token of appreciation.

Support Us

We’re grateful on your by no means ending assist.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments