cd /opt
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh
下载后进行安装,同时指定安装目录,下面是安装和修改目录的步骤
安装
1
bash Miniconda3-latest-Linux-x86_64.sh
修改路径
执行安装指令后,首先会出现类似这样的内容:
1
2
3
4
5
6
Welcome to Miniconda3 py312_24.5.0-0
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
Miniconda3 will now be installed into this location:
/root/miniconda3
- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below
[/root/miniconda3] >>>
这时要输入自己想安装的路径,而不是按ENTER,所以这里输入:
1
/opt/miniconda3
输入后,最后一行应该是这样的:
1
[/root/miniconda3] >>> /opt/miniconda3
这时就可以按【ENTER】了,按下后就会进行安装
执行到这部分后,又需要输入一次yes
1
2
3
4
5
6
7
8
9
Do you wish to update your shell profile to automatically initialize conda?
This will activate conda on startup and change the command prompt when activated.
If you'd prefer that conda's base environment not be activated on startup,
run the following command when conda is activated:
conda config --set auto_activate_base false
You can undo this by running `conda init --reverse $SHELL`? [yes|no]
[no] >>>
输入:yes
然后命令行输出如下内容:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
no change /opt/miniconda3/condabin/conda
no change /opt/miniconda3/bin/conda
no change /opt/miniconda3/bin/conda-env
no change /opt/miniconda3/bin/activate
no change /opt/miniconda3/bin/deactivate
no change /opt/miniconda3/etc/profile.d/conda.sh
no change /opt/miniconda3/etc/fish/conf.d/conda.fish
no change /opt/miniconda3/shell/condabin/Conda.psm1
no change /opt/miniconda3/shell/condabin/conda-hook.ps1
no change /opt/miniconda3/lib/python3.12/site-packages/xontrib/conda.xsh
no change /opt/miniconda3/etc/profile.d/conda.csh
modified /root/.bashrc
==> For changes to take effect, close and re-open your current shell. <==
Thank you for installing Miniconda3!
这时就安装并成功修改路径了
可以通过ls指令看一下miniconda是否安装到这个路径了
1
ls /opt/miniconda3
输出如下:
1
2
3
4
bin condabin include pkgs ssl
cmake conda-meta lib sbin x86_64-conda_cos7-linux-gnu
compiler_compat envs LICENSE.txt share x86_64-conda-linux-gnu
_conda etc man shell