By default sudo is not installed on Debian, but you can install it. First enable su-mode:
su -

Install sudo by running:
apt-get install sudo -y

After that you would need to play around with users and permissions. Give sudo right to your own user.

usermod -aG sudo yourusername

Make sure your sudoers file have sudo group added. Run:
visudo to modify sudoers file and add following line into it (if it is missing):

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

You need to relogin or reboot device completely for changes to take effect.

Answer from Maksim Luzik on Stack Exchange
Top answer
1 of 4
9

Sudo is probably not installed or not in your path

  1. check to see if you are root in this case sudo is not needed unless you are trying to impersonate another user. just run your command without sudo mv composer.phar /usr/local/bin/composer

  2. See if sudo is your path by running which sudo or echo $PATH. If sudo is not in your path, your path variable might be broken. You can try testing this by executing a common location for sudo /usr/bin/sudo or running locate sudo | grep bin to attempt to find its location.

  3. If you know that sudo was installed, or your path looks broken, try fixing your path. Check your distribution's env file (/etc/environment in ubuntu) to make sure that it is formatted correctly (script commands are illegal in this file)

  4. If you are not root and you want to run a command with root prvileges then you must install sudo. But if you don't have sudo and you are not root then you can't install it. In this case I recommend switching to the root user with su

  5. If you do not have the root password and you own the machine, you can reset the root password with a tutorial such as https://askubuntu.com/questions/24006/how-do-i-reset-a-lost-administrative-password

  6. After you manage to login as root install sudo with apt-get update; apt-get install sudosince you are using Ubuntu.

  7. Verify the the name of your sudoers group with visudo and modify your sudoers file if you need to. https://www.digitalocean.com/community/tutorials/how-to-edit-the-sudoers-file-on-ubuntu-and-centos

  8. if you have an existing sudoers group or you create one you can add yourself to the group. For example if your sudoers group is called sudo run usermod -aG sudo myuser. The sudoers group by default in Ubuntu based Linux is sudo. A sudoers group entry looks like this: %sudo ALL=(ALL:ALL) ALL

If you are trying to impersonate another user and cannot install sudo, you can still use su if it is installed and you have permission / password for the other user.

e.g. su someuser

2 of 4
5

As suggested in this post, you may have to install sudo in your server.

To do that, log in as root with the following command: su -. Then install sudo with your package manager (if you're in Ubuntu: apt-get install sudo).

Then add your user to the sudo group: usermod -aG sudo <username>.

Finally type exit to log out of the root account and go back to your user.

Discussions

sudo: command not found - Apple Community
The usb drive is formatted and ... Capitan.app --nointeraction I am getting a response from terminal: sudo: /Applications/Install OS X El Capitan.app/Contents/Resources/createinstallmedia: command not found I am not conversant with terminal and am using the above code from the ... More on discussions.apple.com
🌐 discussions.apple.com
November 30, 2018
sudo: command not found - Raspberry Pi Stack Exchange
My USB stick is now full of backups, and I need to delete at least one to upgrade Nextcloud. I cant. I try rm -f ./nextcloud-bkp_2017* and I get: rm: cannot remove './nextcloud-bkp_20171211.tar': More on raspberrypi.stackexchange.com
🌐 raspberrypi.stackexchange.com
Linux Terminal Error: Sudo command not found
Can you show us exactly what you are typing? I just want to rule out that you are not misinterpreting the error message. Also, what did you do prior to this error happening? Are there other commands that also don't seem to work? If we understand what broke, we can probably figure out how to fix it. But this is an unusual error and will take some sleuthing first. More on reddit.com
🌐 r/Crostini
14
4
December 6, 2022
Command sudo not found
Does "su" work? EDIT: Actually, it will probably be easier to just boot to the root recovery and do stuff from there. Including setting a root password so you can install stuff while the system is actually booted. More on reddit.com
🌐 r/Ubuntu
6
4
April 21, 2019
🌐
99RDP
99rdp.com › home › blog › blog › resolving the ‘sudo’: command not found’ error in linux
Resolving the 'sudo': command not found' Error in Linux
September 25, 2023 - One of the most common reasons for encountering the ‘sudo: command not found’ error is the absence of the ‘sudo’ package on your system.
🌐
DropVPS
dropvps.com › home › blog › how to fix: sudo command not found error
How to Fix: sudo Command Not Found Error
July 5, 2025 - If you see the error: sudo: command not found .It means sudo is either not installed or not in your system’s PATH.
Find elsewhere
🌐
LinuxConfig
linuxconfig.org › home › sudo command not found – solution
Fix 'sudo command not found' in Linux
September 22, 2025 - Learn how to fix 'sudo command not found' error in Linux by installing the sudo package and adding users to the sudo group for root permissions.
🌐
Apple Community
discussions.apple.com › thread › 8653929
sudo: command not found - Apple Community
November 30, 2018 - By default, none of these files exist, but when someone reports they cannot execute some command that should be on every Mac, it is very common that they have one of the above files and it has a mistake that does not modify the PATH environment variable correctly. ... You should see a list of all the directories (separated by colons) where the shell looks for commands to execute when you type something. For my system the list is: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin ... The sudo command with those permissions works for me. If yours are different, you may have found the "root" cause.
🌐
TecMint
tecmint.com › home › linux commands › how to fix “-bash: sudo: command not found” in linux
How to Fix “-bash: sudo: command not found” in Linux
July 14, 2023 - In this guide, we have demonstrated how to resolve the “sudo command not found” error in Linux.
🌐
Baeldung
baeldung.com › home › administration › fixing the “command not found” error when using sudo
Fixing the “Command Not Found” Error When Using Sudo | Baeldung on Linux
March 18, 2024 - $ echo $PATH /usr/bin:/home/baeldung/bin $ myscript My Script Run As baeldung $ sudo myscript sudo: myscript: command not found $ sudo -E myscript My Script Run As root
🌐
Homebrew
docs.brew.sh › Homebrew-on-Linux
Homebrew Documentation: Homebrew on Linux
Homebrew does not use sudo after installation. Using /home/linuxbrew/.linuxbrew allows the use of most binary packages (bottles) which will not work when installing in e.g.
🌐
Wikihow
wikihow.com › computers and electronics › operating systems › linux › how to fix the “sudo command not found” error on linux
How to Fix the “Sudo Command Not Found” Error on Linux
January 30, 2026 - If you receive a "sudo command not found" error when trying to run a sudo command in Linux, it either means the sudo package is not installed, or the sudo directory is not in PATH variable.
🌐
MonoVM
monovm.com › blog › tutorials › how to fix "sudo command not found error" on linux?
How to fix "Sudo Command not found error" on Linux?
March 5, 2023 - Being a command, sudo is also a package that comes installed by default on the Linus systems. However, certain Linux distributions do not get sudo installed, and when you run the command on such systems, you receive the error message “sudo: command not found.”
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › beginner questions
PROBLEM = sudo: ./install: command not found - Linux Mint Forums
May 5, 2024 - user@user-ThinkPad-S5-S540:~/Desktop/LabelPrinter-1.1.0$ ls i386 install LabelPrinter.ppd uninstall x86_64 user@user-ThinkPad-S5-S540:~/Desktop/LabelPrinter-1.1.0$ sudo ./install [sudo] password for user: sudo: ./install: command not found user@user-ThinkPad-S5-S540:~/Desktop/LabelPrinter-1.1.0$ ___________________________________________________________ It's the same result if I use the full path to the 'install' file.
🌐
Helm
helm.sh › introduction › installing helm
Installing Helm | Helm
sudo apt-get install curl gpg apt-transport-https --yes
🌐
CloudCone
cloudcone.com › home › how to fix sudo command not found in debian 10
How To Fix Sudo Command Not Found In Debian 10 - Tutorials and How To - CloudCone
October 13, 2020 - Recently, I deployed a Debian 10 managed VPS and noticed that I could not execute privileges tasks by invoking the sudo command. Instead, I got the error ‘sudo command not found in Debian 10′. Turns out that the sudo command-line tool is not present by default. However, I managed to fix ...
🌐
Amazon Web Services
docs.aws.amazon.com › aws command line interface › user guide for version 2 › getting started with the aws cli › installing or updating to the latest version of the aws cli
Installing or updating to the latest version of the AWS CLI - AWS Command Line Interface
To verify that the shell can find ... Darwin/23.3.0 · If the aws command cannot be found, you might need to restart your terminal or follow the troubleshooting in Troubleshooting errors for the AWS CLI....