This is actually covered in the documentation: Multi-user Anaconda installation on Linux
The documentation is very brief. Here are step by step instructions:
Download Anaconda
Before you start, you have to decide on the installation location. I would recommend /opt/anaconda3
.
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`
- 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
- 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
- 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.