Bash Script Non-Interactive Installation
When running the Miniconda installation script, the -b option enables "non-interactive mode" installation. This means the installation process runs automatically without requiring any input or confirmation from the user. Specifically, the -b option will:
- Automatically accept the license agreement.
- Use the default installation path (typically the
miniconda3directory under the user's home directory). - Skip all prompts and interactive steps.
This approach is particularly useful for scripted installations or when you want to install Miniconda automatically without user intervention.
Example
Here is the command to perform a non-interactive installation using the -b option:
bash Miniconda3-latest-Linux-x86_64.sh -b
After Installation
After the installation completes, you need to manually add Miniconda to your PATH environment variable so you can use the conda command. Typically, you can do this by adding the following line to your shell configuration file (such as .bashrc or .bash_profile):
export PATH="$HOME/miniconda3/bin:$PATH"
Then reload the configuration file:
source ~/.bashrc
or
source ~/.bash_profile
Finally, verify that Conda was installed successfully:
conda --version
Complete Non-Interactive Installation Example
-
Download the Miniconda installation script:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -
Run the installation script with non-interactive mode enabled:
bash Miniconda3-latest-Linux-x86_64.sh -b -
Configure the PATH environment variable:
echo 'export PATH="$HOME/miniconda3/bin:$PATH"' >> ~/.bashrc -
Reload the configuration file:
source ~/.bashrc -
Verify the installation:
conda --version
With these steps, you can quickly install Miniconda in non-interactive mode and ensure the conda command is available.