The rustup-init occurs an error on Centos7

I'm trying to install Rust compiler on Centos7, however, it gives an error with

invalid instruction, "$@"

I don't know what's the reason here. How to correctly install rust compiler on centos7?

You can try directly downloading rustup-init from Other installation methods - The rustup book

The install script reports "$@" error in the centos7 system.

@bjorn3's link contains rustup-init executables for various architectures Rust is available on. Are you able to download one of those executables and run it directly?

That will help you get around the problem if there is a bug in the install script on centos7 or you are using a shell that doesn't support the $@ syntax.

If the problem persists, please provide more information about the error message (e.g. the complete terminal output including the command you executed) or any other relevant details to help further troubleshoot the issue.

No further information, the terminal just reports that brief error, on centos7.

This error shouldn't be possible if you directly run rustup-init rather than download the script from https://sh.rustup.rs and run this script. rustup-init is a native executable which doesn't run any shell commands.

I just directly run rustup-init, in the same way as documented on the official web

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

This command gives me that error.

That won't run rustup-init directly. You are fetching a shell script and executing it with sh, and it looks like whatever shell is associated with sh on your computer isn't able to understand $@ syntax.

Have a look at the links on @bjorn3's page, download the x86_64-unknown-linux-gnu binary, and run it from the command-line. You may need to chmod +x it.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.