下载用wget命令,如wget https://repo.anaconda.com/miniconda/miniconda3-latest-linux-x86_64.sh;安装执行需chmod +x加bash或./运行脚本;初始化必须选yes;生效用source ~/.bashrc;验证需conda create、activate和python -c三连通。

conda 命令本身不是系统自带的,它必须通过安装 Miniconda 后才可用。所以“Ubuntu 系统安装 Miniconda 的命令行”不是单个命令,而是一组有明确顺序的操作步骤,每一步都对应关键命令。
下载 Miniconda 安装脚本用什么命令?
最常用、最稳妥的是用 wget 从官方源或镜像站下载:
-
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh(官方源,适合多数人) -
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh(清华镜像,国内更快)
注意:x86_64 适用于 Intel/AMD 普通 Ubuntu;如果是 ARM 服务器(如树莓派、华为鲲鹏),得换用 aarch64 后缀。
安装脚本执行时的关键命令是什么?
下载完后不能直接双击——Linux 下要靠终端执行。三步缺一不可:
- 赋予执行权限:
chmod +x Miniconda3-latest-Linux-x86_64.sh - 运行安装向导:
bash Miniconda3-latest-Linux-x86_64.sh或./Miniconda3-latest-Linux-x86_64.sh - 安装过程中必须输入
yes接受协议,并在最后一步输入yes回应Do you wish to initialize Miniconda3 by running conda init?——这步漏掉,conda命令就永远不生效。
如果跳过了初始化,后续得手动运行:~/miniconda3/bin/conda init bash,再 source ~/.bashrc,但容易出错,不如一开始就选 yes。
Miniconda py314_26.5.3-2 Linux x86_64 安装脚本,来自 Anaconda 官方 Miniconda 下载目录,适合服务器、工作站和容器环境配置轻量 Conda 与 Python。
安装后让 conda 命令生效的命令是?
conda 命令生效的命令是?安装脚本里选了 yes 初始化,也得重新加载 shell 配置才能立刻用:
- 对大多数 Ubuntu 用户(用
bash):source ~/.bashrc - 如果你改用了
zsh(比如装了 Oh My Zsh):source ~/.zshrc
执行后,终端提示符前出现 (base) 就说明成功了。此时输入 conda --version 应该能输出版本号,conda list 能列出默认包。
验证是否真装好了:最容易忽略的检查点
很多人以为看到 (base) 就万事大吉,但实际常踩两个坑:
-
conda activate报错CommandNotFoundError: Your shell has not been properly configured...→ 说明conda init没走完,或者source没执行,或配置被其他工具(如 oh-my-zsh 插件)覆盖了。 -
conda install numpy卡住或超时 → 很可能没配镜像源,此时要立刻补上:conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/和conda config --set show_channel_urls yes。
真正可靠的验证不是看有没有 (base),而是跑一次 conda create -n testenv python=3.10 && conda activate testenv && python -c "print('ok')" ——这三连动作全通,才算环境可交付使用。










