How to fix "sudo: command not found" error

The sudo stands for superuser do. It is a program that enables users to execute commands or programs using superuser permissions.

The sudo package is pre-installed in most of the Linux distros, but this might not be the case in some. So if we try to use the sudo command in the systems where sudo is not installed, we'll get the "sudo: command not found" error.

In the below terminal, if we try to use the sudo command, we'll get the error "sudo: command not found."

Terminal 1
Terminal
Loading...

To resolve the error, we need to install the sudo package.

Syntax

apt install sudo

Code example

Let's go through an example below:

Terminal 1
Terminal
Loading...

We can see that after installing the sudo package, we resolved the "sudo: command not found" error.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved