Shell error solution 1—— -bash: sudo: command not found

Error content

When running the model, I encountered the following error:

-bash: sudo: command not found

It probably means that sudothe relevant command was not found. Since the server I am using is brand new, and the relevant environment and commands are not pre-configured, there is a high probability that this is the problem.

Error resolution

First enter this line of command:

find /etc/sudoers.d

The meaning of this line of command is to go to etcthis folder to find if there is sudoers.dsuch a file.

Usually there are two return results after input:

(1) Return No such file or directory, which means that we have not installed sudo, so there is no sudoers.dsuch file. It can be installed with the following command:

apt-get install sudo

(2) Return E: Unable to locate package sudo, which means sudoit exists, but cannot be found. At this time, just use the following command to update:

apt-get update

The update update is also a solution to many related error reports. If you are in doubt, you can update it directly~

Guess you like

Origin blog.csdn.net/m0_61787307/article/details/129779196