9

What I Want To Do

I want to install conda on our shared computer on premises in such a way that it can be used by all users. Users are accessing the machine through remote desktop using xRDP from Windows.

What I did

I was following the tutorial on linux hint to the point where the tutorial suggests to install conda in /home/username/anaconda3.

What is the problem

However I assume this installation would make it available to me only as I am not running it as a root. Additionally, the anaconda installation also modifies the ./bashrc file which is also user specific by default, so the other users would not have the possible modifications included.

What is the correct way to take?

  1. Should I install it as a root?
  2. Should I install it in my home directory, but change the permissions for the other users to be able to execute it?
  3. Should I install it under my user account, but put it somewhere all users have access to? Where would be the best place to install it?
  4. Is the way you potentially recommend something I should apply to all future programes I install on the computer and want them to be used by all users?

Thank you

Thank you for direct answer or redirection to relevant source or a chapter in a book on Linux administration. I am new to this and trying to learn these probably obvious things.

Vladimir
The Curious Mechanobiologist

  • 1
    Did you try following the instruction installation on the Anaconda web page? https://docs.anaconda.com/anaconda/install/multi-user/#multi-user-anaconda-installation-on-linux – noisefloor Mar 04 '23 at 13:00
  • I would go for option 3: install it first in your home directory, then (as root) move the anaconda3 folder to somewhere where all users can access it (like /opt). As I see it, the modification to .bashrc needs to be done for every user, if that is feasible. – Jos Mar 04 '23 at 13:07
  • Thank you noisefloor and Jos, will try that. Thanks for pointing out the docs. They are nicely made. – Vladimir Vinarsky Mar 04 '23 at 14:03

1 Answers1

11

This is actually covered in the documentation: Installing for multiple users (Linux).
The documentation is very brief. Here are step by step instructions:

  1. Download Anaconda

  2. Before you start, you have to decide on the installation location. I would recommend /opt/anaconda3.

  3. Install anaconda as root with sudo. During the installation, you will be asked to enter the installation location (from the previous step). When asked whether to initialize anaconda, say no. (Saying yes will initialize it just for root, which is harmless but useless).

    sudo bash ./Anaconda3-2023.03-Linux-x86_64.sh`
    
  4. We provide access with groups. The documentation uses the (nondescript) group name "mygroup". I recommend anaconda instead.

    sudo groupadd anaconda
    sudo chgrp -R anaconda /opt/anaconda3
    sudo chmod 770 -R /opt/anaconda3
    
  5. Each user who wants to use anaconda must be added to that group. Note that you need to log out or otherwise refresh your shell to see your new membership.

    sudo adduser USER_TO_BE_ADDED anaconda
    
  6. Last, each user who wants to use conda needs to add it to their path. This can be done following the instructions in the installation doc:

    source /opt/anaconda3/bin/activate
    conda init
    

Make anaconda available automatically for all new users

Based on your question, you might want to allow all users to use anaconda by default. In that case, make the group ownership part of your new user template (step 5). Also look at the changes that step 6. does to the user's .bashrc and make that part of new user's .bashrc template.

zx485
  • 2,894
jastram
  • 283
  • 3
    I had to reboot between step 5 and 6 – Harley Feb 03 '24 at 00:23
  • if user-added environments should be accessible (and also extensible) by everyone (shared projects) you need to set the GID flag on the respective folder(s) – N4ppeL Apr 18 '24 at 16:59
  • I suggest sudo chmod 750 -R /opt/anaconda3, as you probably don't want group members to be able to write there. – maltem-za Jul 03 '25 at 12:19
  • You may also want to disable automatic activation of the base environment at the system level: 1) sudo su - 2) source /opt/anaconda3/bin/activate 3) conda config --system --set auto_activate_base false 4) logout. – maltem-za Jul 03 '25 at 12:31