Score:2

How and where to install conda to be accessible to all users

ru flag

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

noisefloor avatar
ec flag
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
uz flag
Jos
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.
Vladimir Vinarsky avatar
ru flag
Thank you noisefloor and Jos, will try that. Thanks for pointing out the docs. They are nicely made.
Score:1
ru flag

This is actually covered in the documentation: Multi-user Anaconda installation on 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`
  1. 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
  1. 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
  1. 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.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.