You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Sudo Fails with Error Message Ending With "/usr/bin/sudo: No such file or directory"

edited Nov 9, 2022 9:04AM in Linux

An Oracle Linux or Red Hat Linux based server tries to run sudo commands, but the commands fail with the following error message: "/opt/rh/devtoolset-11/root/usr/bin/sudo: line 41: /usr/bin/sudo: No such file or directory", such as in the following example:

# sudo -i

/opt/rh/devtoolset-11/root/usr/bin/sudo: line 41: /usr/bin/sudo: No such file or directory

This error is caused by an error in the sudo wrapper script installed by the devtoolset-* package (such as in devtoolset-11 in the prior example). The devtoolset-* package sets the user's PATH so the sudo wrapper script occurs in the path before the operating system's standard sudo package (which is installed in the /usr/bin directory). Older versions of the devtoolset-* package's sudo wrapper script can encounter errors when parsing some sudo options.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!