![]() I will check for my user " dev" in this example. Open /etc/passwd file and check whether your user is added to the sudo group or not. Step1.4 Give sudo rights to your own user by adding it to the sudo group # usermod -aG sudo yourusernameįor example, I will add my user "dev" to sudo group - # usermode -aG sudo dev Step1.5 Verify your user is added to the sudo group Refer to the following image for reference. Step1.3 Run apt command to install sudo package in Ubuntu/Debian # apt install sudo If you don't have a root password, then follow this link to reset your root password. You would need root access to achieve this. If you don't have the sudo package installed, run the following command to install it in Ubuntu or Debian based distros. Then you can directly move to solution-2 to fix the " sudo: command not found error". If you can find package name sudo with " installed" status as shown in the image. Follow these steps to fix it - Step1.1 List installed packages in Ubuntu and look for the "sudo" package $ apt list -installed | grep -i sudo Still, you may get this situation when you have installed the Debian Linux with the minimal package. This is very uncommon when sudo is not installed by default with Linux installation. Let's deep dive and find the fixes for different scenarios - Solution-1 Check and install sudo package I am running this command in Ubuntu 21.04 installed as VM. As you will see in the image, running the "sudo ifconfig -a" command results in " bash: /usr/bin/sudo: No such file or directory error". How to fix sudo command not found error in Debian/Ubuntu like DistrosĪs we discussed already, there may be many reasons to encounter this error. The " sudoers" file controls, who can use the sudo command to gain elevated access and location is /etc/sudoers in all Linux distributions. ![]() Also, the operations which are only permitted by a root user can be done using a normal user with sudo rights. It allows running any Linux command with elevated privileges to run administrative tasks. Sudois one of the famous prefixes to any command you run in the Linux world. You are trying to ssh a remote server first time and sudo is not workingīefore getting into the solutions, if you are a newbie let's understand why sudo is used? Why sudo is used in Linux before every command?.You have installed a linux distribution with minimal package like Debian.These are the common scenarios that result in this error. bash: /usr/bin/sudo: No such file or directory.so if you are getting any of the following errors, this post will definitely solve your error. ![]() So I decided to write a post, which covers all the scenarios of this famous error.īelow mentioned errors will be covered in this post. For me whenever I try to ssh into any of the remote servers and run sudo, I get this "bash: sudo commands not found error". One of the common examples, when you have installed Debian with a minimal package and trying to run sudo. There are many scenarios when you get " sudo command not found error" and you keep looking for solutions on the internet to fix it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |