Here’s how to install conda for multiple users.

  1. Download Miniconda install script from https://docs.anaconda.com/free/miniconda/index.html
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x Miniconda3-latest-Linux-x86_64.sh

-OR-

curl -OLJ https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x Miniconda3-latest-Linux-x86_64.sh
  1. Install Miniconda3

    • Target directory: /usr/local/conda
    • Activate base by default? No
sudo ./Miniconda3-latest-Linux-x86_64.sh -b -p /usr/local/conda
  1. Generate a global configuration

Create a system-wide configuration, /usr/local/conda/.condarc, to force to use system-wide package cache and to skip activating base environment.

---
pkg_dirs:                         #!final
  - /usr/local/conda/pkgs
auto_activate_base: false         #!final
  1. Create a group and adjust permissions

Create a system group, conda-users and make the group owned all conda files/directories.

sudo groupadd -r conda-users
sudo chgrp -R conda-users /usr/local/conda

Make pkgs directory group-writable and set-gid so that any users in the conda-users group can write/create files/folders and the files/directories have conda-users group.

sudo find /usr/local/conda/pkgs -type d -exec chmod g+ws {} \;
sudo find /usr/local/conda/pkgs -type f -exec chmod g+w {} \;

Optional) set umask 0002 for any shells.

echo "umask 0002" | sudo tee /etc/profile.d/umask.sh

To add user to the group:

sudo usermod -aG conda-users <user-id>
  1. Apply conda for any shells
sudo cp /usr/local/conda/etc/profile.d/* /etc/profile.d/