How can I install the latest Anaconda with wget

Question:

I’m looking at installing anaconda via wget on my server. I’ve come across https://askubuntu.com/questions/505919/installing-anaconda-python-on-ubuntu and http://ericjonas.com/anaconda.html and it looks promising . As of this writing the current version( https://www.continuum.io/downloads#_unix ) is 4.0 . How can I wget the latest version.

Asked By: user1592380

||

Answers:

wget just downloads the file…

for python 2.7 :

wget https://repo.continuum.io/archive/Anaconda2-2018.12-Linux-x86_64.sh

for python3.X:

wget https://repo.continuum.io/archive/Anaconda3-2018.12-Linux-x86_64.sh

This is a shell script that guides you though the install.

Run the following line inside of the folder of the downloaded file to start the guided install…

for python 2.7:

bash Anaconda2-2018.12-Linux-x86_64.sh

for Python 3.X:

bash Anaconda3-2018.12-Linux-x86_64.sh

Check latest repos or if you want any specific version here:
https://repo.continuum.io/archive/

Answered By: Bruce Pucci
wget 
    https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh 
    && bash Miniconda3-latest-Linux-x86_64.sh -b 
    && rm -f Miniconda3-latest-Linux-x86_64.sh 
    && eval "$(/home/$USER/miniconda3/bin/conda shell.bash  hook)"
    && conda init
Answered By: Soren

This will download the latest anaconda version from scraping the html from the website:

wget -O - https://www.anaconda.com/distribution/ 2>/dev/null | sed -ne 's@.*(https://repo.anaconda.com/archive/Anaconda3-.*-Linux-x86_64.sh)">64-Bit (x86) Installer.*@1@p' | xargs wget
Answered By: philipper

You can write the following bash script to automate the installing process.

cd ~

wget https://repo.continuum.io/archive/Anaconda3-2020.11-Linux-x86_64.sh
bash Anaconda3-2020.11-Linux-x86_64.sh -b -p ~/anaconda3
rm Anaconda3-2020.11-Linux-x86_64.sh
echo 'export PATH="~/anaconda3/bin:$PATH"' >> ~/.bashrc 

# Reload default profile
conda init

source ~/.bashrc

Answered By: Zabir Al Nazi

I would just go to https://repo.anaconda.com/archive/ and copy the link of the most recent dated release and use wget with that.
For example, right now it would be:

wget https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh

If you want a more automatic way you could try the following.

Using @philipper solution as a starting point I made some modifications.

  latest=$(wget -qO- https://repo.anaconda.com/archive/  | 
  grep -Eo "(href=")(Anaconda3-.*-Linux-x86_64.sh)*"" | 
  sed 's/href=//g' | sed 's/"//g' | head -n 1); wget "https://repo.anaconda.com/archive/$latest"

The script will download the html of the repo archive page.
Parse out all href tags matching Anaconda3 for Linux-x86 _64 (1st sed).

I strip out the "href=" and quotes from that output (2nd & 3rd sed).

I then get the first entry which will be the most recent and set it to the variable latest. Then use wget to download from the full url.

Either way, once it’s downloaded you’ll most likely need to make the .sh file executable then you can just run it like a normal .sh file.

I would just do it the first way but the second way does work for now at least.

I’m not really good at bash or using sed so my "automatic" solution might have some issues.

Answered By: kconsiglio

How to install latest Anaconda (2022)

$ ANACONDA_VERSION=$(curl -sS https://repo.anaconda.com/archive/ | grep -Po '(?<=Anaconda3-)([0-9.]*)(?=-Linux-x86_64)' | head -n1)
$ ANACONDA_URL="https://repo.anaconda.com/archive/Anaconda3-${ANACONDA_VERSION}-Linux-x86_64.sh"
$ wget $ANACONDA_URL && bash $(basename $ANACONDA_URL) -b
  • https://repo.anaconda.com/archive/ lists the release anaconda installer binaries, in the order of latest released.
  • The grep command grep -Po '(?<=Anaconda3-)([0-9\.]*)(?=-Linux-x86_64)' extracts the dddd.dd string, where Anaconda3- and -Linux-x86_64 are lookahead patterns. grep -Po is a useful, clean command to extract some regex pattern from a string (one could do with sed as well).
  • | head -n1 : choose whichever comes the first, i.e. the latest release.

Miniforge / Miniconda (automatic latest):

$ MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh"
$ wget $MINIFORGE_URL && bash $(basename $MINIFORGE_URL) -b
$ MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"
$ wget $MINICONDA_URL && bash $(basename $MINICONDA_URL) -b

Remarks

Note: the -b option is for the "batch mode" — no question asked, accept the license, etc. and just install the anaconda for you. One may also find the option -p $CONDA_PREFIX useful.

Answered By: Jongwook Choi

As of April 2023

For windows

wget https://repo.continuum.io/archive/Anaconda3-2023.03-Windows-x86_64.exe

For MacOS based on your system architecture

wget https://repo.continuum.io/archive/Anaconda3-2023.03-MacOSX-x86_64.sh

wget https://repo.continuum.io/archive/Anaconda3-2023.03-MacOSX-x86_64.pkg

wget https://repo.continuum.io/archive/Anaconda3-2023.03-MacOSX-arm64.sh

wget https://repo.continuum.io/archive/Anaconda3-2023.03-MacOSX-arm64.pkg

For linux based on your system architecture:

wget https://repo.continuum.io/archive/Anaconda3-2023.03-Linux-x86_64.sh

wget https://repo.continuum.io/archive/Anaconda3-2023.03-Linux-s390x.sh

wget https://repo.continuum.io/archive/Anaconda3-2023.03-Linux-ppc64le.sh

wget https://repo.continuum.io/archive/Anaconda3-2023.03-Linux-aarch64.sh

For future references,

Just move to here https://repo.anaconda.com/archive/ and download that is suitable for you.

Answered By: Ankur Lahiry
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.