Before attempting to fix this error double check the syntax to ensure the command you’re trying to run is correct. If you haven’t done so yet you’ll need to enable the root user, this may be all that’s needed to fix the error.

If the command is still not working it can mean it is not installed, deleted or in the worst cases the system directory has been deleted or modified. However, the most common reason for this error is an issue with $PATH.

What is $PATH?

PATH is an Environment Variable that contains a list of directories that tells your system where to look for executable programs. To find the value of your PATH variable type the following command into the terminal:

echo $PATH

To set $PATH to the default Mac OS path use the following command:

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

This should be all that’s needed to fix the “sudo: command not found” error.


If you are looking to get your device repaired by an Apple Authorised Service Provider, you can do so by:

Disclaimer: Any actions taken as a result of this article are at the individuals discretion. Whilst all the information is checked to be accurate, Amsys will not compensate for any damage or inconvenience. If you do not feel comfortable performing any of the actions noted above please either book a repair or contact Apple support.