This question already has an answer here:

I get this error while installing. And when I use sudo, it says command not found.

$ conda update conda
Solving environment: done

## Package Plan ##

environment location: /home/raworm/anaconda

added / updated specs: 
- conda

The following packages will be UPDATED:

conda: 4.4.10-py36_0 --> 4.4.11-py36_0

Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: failed
ERROR conda.core.link:_execute(481): An error occurred while 
uninstalling package 'defaults::conda-4.4.10-py36_0'.
PermissionError(13, 'Permission denied')
Attempting to roll back.

Rolling back transaction: done

PermissionError(13, 'Permission denied')

This is what happens when I use sudo:

 $ sudo conda update conda
 sudo: conda: command not found

Neither can I use pip in sudo, I keep getting the same error:

sudo: pip: command not found

How to solve this?

marked as duplicate by David Foerster, karel, Eric Carvalho, Fabby, Kevin Bowen Jul 8 '18 at 17:10

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.

  • Did you find solution for this by any chance? I am facing same issue. – Usama Zafar Mar 27 '18 at 9:06
  • Welcome to Ask Ubuntu! Could you please edit your question to include the output of which conda pip? Thanks. – David Foerster Jul 8 '18 at 0:56

All conda commands must be run without super user privileges. That's why sudo conda command doesn't work.

You may have run conda installation bush file with super user privileges while installing. The user (raworm) running conda doesn't have write permissions to paths(/home/raworm/anaconda) it needs to modify in the environment, then conda can't do anything. To solve this problem you need to change permissions to paths (/home/raworm/anaconda).

To change permissions to paths (/home/user/anaconda) using:

sudo chown -R user /home/user/anaconda
  • This does not specify how to change the permission to that specific directory. – Stephen Rauch Jul 7 '18 at 22:39

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