Skip to content

Instantly share code, notes, and snippets.

@maurerle
Last active March 7, 2024 09:50
Show Gist options
  • Save maurerle/46959dbcbbd4c890523fe46d96bc1e72 to your computer and use it in GitHub Desktop.
Save maurerle/46959dbcbbd4c890523fe46d96bc1e72 to your computer and use it in GitHub Desktop.
Installation script for miniconda using the deb package - look at https://github.com/tartansandal/conda-bash-completion for autocompletion
#!/bin/bash
set -e
# Check for root priviliges
if [[ $EUID -ne 0 ]]; then
printf "Please run as root:\nsudo %s\n" "${0}"
exit 1
fi
# for more information look here: https://docs.conda.io/projects/conda/en/latest/user-guide/install/rpm-debian.html
# Install our public GPG key to trusted store
curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > conda.gpg
install -o root -g root -m 644 conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg
# Check whether fingerprint is correct (will output an error message otherwise)
gpg --keyring /usr/share/keyrings/conda-archive-keyring.gpg --no-default-keyring --fingerprint 34161F5BF5EB1D4BFBBB8F0A8AEB4F8B29D82806
# Add our Debian repo
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list
apt update
apt install conda
echo "source /opt/conda/etc/profile.d/conda.sh" >> /etc/bash.bashrc
echo "auto_activate_base: false" >> /opt/conda/.condarc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment