Can someone tell me why I get this error when I try to add a repository and what if anything I can do about it?

When I try to add a repository using:

sudo add-apt-repository ppa:upubuntu-com/tor

I get the following error:

Command 'sudo' is available in '/usr/bin/sudo'
The command could not be located because '/usr/bin' is not included in the PATH      
environment variable.
sudo: command not found

marked as duplicate by Sylvain Pineau, Avinash Raj, Danatela, Eric Carvalho, Seth May 2 '14 at 4:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Your PATH variable has been messed up. Unless you are trying to run a restricted user with rbash, you should have /usr/bin in $PATH. For a terminal session you can fix this by running:

export PATH="/usr/bin:$PATH"

As @SylvainPineau mentioned, this answer covers how to permanently fix your path by editing the /etc/environment file.

  • 2
    or export PATH="/usr/sbin:$PATH" – Buminda Mar 8 '17 at 5:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.