Unable to update Anaconda packages on Ubuntu 17.04

8,521

Solution 1

This is a very common issue online and I found no solution for it on AskUbuntu or StackOverflow and hence I am posting this answer.

Anaconda comes as a .sh file which is to be installed with the following command

bash Anaconda3-4.3.1-Linux-x86_64.sh

Now even though I have done it before for some reason I added a sudo before this command rendering the anaconda3 folder inaccesible without root permission.

Therefore the conda package management system could not access the directory and hence the issue. If such an issue exists simply delete the previous installation instance with sudo rm -rf anaconda3 and reinstall.

Thanks to George for his valuable comments!

Solution 2

Though Djokester's answer should work fine, it seems like terrible overkill to me. One could just do:

sudo chown -R username:username anaconda3

Where username is your users name.

Share:
8,521

Related videos on Youtube

djokester
Author by

djokester

I teach machines how to learn the human language. I am a Machine Learning Engineer at Chefling Inc where I combine my love for food with my passion for artificial intelligence to build a really smart kitchen assistant. IIT Kharagpur alumnus and former Student Software Developer under Google Summer of Code. I am an avid coder, amateur writer, and poet, full-time foodie. Welcome to my Website!

Updated on September 18, 2022

Comments

  • djokester
    djokester over 1 year

    The following message is being displayed whenever I am attempting to update any package with conda update package-name

    I have installed Anaconda previously on 16.04 and 16.10 with no such issues.

    CondaIOError: IO error: Missing write permissions in: /home/samriddhi/anaconda3
    #
    # You don't appear to have the necessary permissions to update packages
    # into the install area '/home/samriddhi/anaconda3'.
    # However you can clone this environment into your home directory and
    # then make changes to it.
    # This may be done using the command:
    #
    # $ conda create -n my_root --clone=/home/samriddhi/anaconda3
    
    • George Udosen
      George Udosen almost 7 years
      Check permissions with ls -al /home/samriddhi/anaconda3
    • steeldriver
      steeldriver almost 7 years
      . . . or namei -l /home/samriddhi/anaconda3 to see the parent permissions also
    • djokester
      djokester almost 7 years
      > f: /home/samriddhi/anaconda3 > drwxr-xr-x root root / > drwxr-xr-x root root home > drwxr-xr-x samriddhi samriddhi samriddhi > drwxr-xr-x root root anaconda3
    • George Udosen
      George Udosen almost 7 years
      So there you are that's the problem, root owns it
    • George Udosen
      George Udosen almost 7 years
      Mine is drwxrwxr-x 20 george george 4096 Mar 18 09:02 anaconda2/
    • djokester
      djokester almost 7 years
      What should I do install as non-root?
    • George Udosen
      George Udosen almost 7 years
      Remove that /home/samriddhi/anaconda3, run the installer bash Anaconda3-4.2.0-Linux-x86_64.sh from then on run the conda command without sudo prefix. Please note the .sh installer may not be the latest download the latest