Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

run rustup's curl-fetched installer script non-interactively

Tags:

linux

ubuntu

I am trying to automate stuff which includes installing rust through

curl https://sh.rustup.rs -sSf | sh

This is interactive and queries for user-input to choose from i.e. "1" "2" or "3".

Not able to figure out, how to input.

Normally for apt-get, "-y" option try to capture and input for prompt.

Not sure, how it is done for curl.

How can I do this?

like image 922
Chirag Dhyani Avatar asked Jul 29 '19 10:07

Chirag Dhyani


1 Answers

To make the installation unatended you can run

curl https://sh.rustup.rs -sSf | sh -s -- -y

If you are ssh'd you should add the nohup parameter in front

With the -s parameter, you set sh to read commands from the standard input, and then you pass the -y to auto accept the options

For more info about sh you can see the man pages

like image 163
Andreu Gallofré Avatar answered Sep 27 '22 22:09

Andreu Gallofré