-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathminiconda_install.sh
executable file
·55 lines (46 loc) · 1.36 KB
/
miniconda_install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# Determine the operating system
OS=$(uname)
ARCH=$(uname -m)
echo "Detected OS: $OS"
echo "Detected Architecture: $ARCH"
# Set installer URL based on OS and architecture
if [ "$OS" = "Linux" ]; then
case "$ARCH" in
x86_64)
CONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-py39_24.1.2-0-Linux-x86_64.sh"
;;
aarch64|arm64)
CONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-py39_24.1.2-0-Linux-aarch64.sh"
;;
*)
echo "Unsupported Linux architecture: $ARCH"
exit 1
;;
esac
elif [ "$OS" = "Darwin" ]; then
case "$ARCH" in
x86_64)
CONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh"
;;
arm64)
CONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh"
;;
*)
echo "Unsupported macOS architecture: $ARCH"
exit 1
;;
esac
else
echo "Unsupported operating system: $OS"
exit 1
fi
echo "Using installer URL: $CONDA_URL"
# Download the installer
curl -O "$CONDA_URL"
# Extract the installer filename
INSTALLER=$(basename "$CONDA_URL")
bash "$INSTALLER"
# Remove the installer file after installation
rm -f "$INSTALLER"
echo "Miniconda installation completed successfully."