Many newbies may panic in this error when they try to ssh into a server via command line or when they are trying CLI (Command Line Interface) for the very first time. Don’t panic, if you are here means your issue is solved.
-bash: sudo: command not found
Let’s see what is this and how to fix it.
What Is This Error?
The system is prompting that sudo command is not there in system to run.
It happens when the system is installed with minimal run version. Or installer is used on very low resource system with minimal resources. By default Debian doesn’t install sudo application when the system is installed with minimum package.
What Is the Solution to This Error?
Simple, just switch to root user and install sudo. That’s it.
If you are a regular user, then switch to root user.
su -
Now, install sudo.
apt install sudo
This is optional, but you may need this!
Want to make normal user sudo. If you installed the system with root and a normal user as well, you’ll find that the regular user won’t be allowed to do sudo operations.
So it is better idea to make normal user sudo enabled.
usermod -aG sudo username
Now exit and back to normal user.
exit
Now you will be back to normal user again. Now try to run sudo commands, it will run normally.
Leave a Reply