-1

Is there any way to automate the installation of this software using shell script? The problem is that I have to press ENTER and type YES twice and I am not sure how to use these 4 steps.

wget https://github.com/conda-forge/miniforge/releases/download/4.8.3-4/Miniforge3-Linux-aarch64.sh

bash Miniforge3-Linux-aarch64.sh

When I run the command mentioned above, I have these 4 steps:

 press ENTER
 type YES
 press ENTER
 type YES

I want to add this installation as a shell script in docker file or (if possible) directly in dockerfile.

shantanuo
  • 31,689
  • 78
  • 245
  • 403

2 Answers2

1

Like this:

chmod +x Miniforge3-Linux-aarch64.sh
./Miniforge3-Linux-aarch64.sh -b 

(batch mode).

Check:

./Miniforge3-Linux-aarch64.sh -h

-b run install in batch mode (without manual intervention), it is expected the license terms are agreed upon

Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223
0

You could use the functions expect & send from the package expect.

Man Page
Answer found here

SomeUsername1
  • 169
  • 1
  • 10
  • 1
    True esp. on Ubuntu it adds a lot of other packages to the system (up to 150+ MB; on Arch it was ~3MB due to depending on Tcl and 300kB for the package itself). Just thought it might be helpful in case there are other dependencies requiring interaction, not having a batch mode. – SomeUsername1 Jul 05 '20 at 03:01
  • This is not a solution as-is, should belongs to a comment – Gilles Quénot Jul 05 '20 at 11:13