我正在尝试使用bash脚本在我自己的docker容器中安装anaconda。问题是有一个许可协议,你需要按住一个密钥才能同意,而它的长度取决于你的终端窗口大小。有没有办法绕过这个问题,让我可以从头到尾从另一个bash脚本运行Anaconda3-5.1.0-Linux-x86_64.sh?
我尝试过echo "\n\n\n\n\n\n\n" | ./Anaconda3-5.1.0-Linux-x86_64.sh,但这只在安装程序第一次要求按Enter键时才起作用。
发布于 2018-04-17 04:29:44
试试yes command吧。
yes | ./Anaconda3-5.1.0-Linux-x86_64.sh至于你的问题
如果最后一个选项是问我是否要安装Visual Studio代码,而我想回答“不”,那该怎么办?
尝尝这个
yes no | ./Anaconda3-5.1.0-Linux-x86_64.sh或者用你认为合适的回答来代替"no“。
发布于 2020-05-04 14:45:50
看起来您已经找到了-b标志,但作为参考,下面是在$HOME/anaconda3中安装anaconda的完整的小脚本。
#!/usr/bin/env bash
_anaconda_version=2020.02
_anaconda_file="Anaconda3-${_anaconda_version}-Linux-x86_64.sh"
cd
rm -f ${_anaconda_file}*
rm -rf anaconda3/
wget https://repo.anaconda.com/archive/${_anaconda_file}
bash ${_anaconda_file} -b
echo "y" | conda update --all
rm ${_anaconda_file}
unset _anaconda_version _anaconda_file发布于 2020-06-18 03:42:10
bash ./Anaconda3-5.1.0-Linux-x86_64.sh -b -p $HOME/anaconda3-b -批处理模式,不修改~/.bashrc的路径。假设您同意许可协议。不编辑.bashrc或.bash_profile文件。
-p -安装前缀/路径。
-f -即使前缀-p已经存在,也强制安装。
参考:https://docs.anaconda.com/anaconda/install/silent-mode/#linux-macos
https://stackoverflow.com/questions/49865531
复制相似问题