How to install Rust remotely on Red Hat Enterprise Linux 7.8 using rustup

Hello,

I want to install Rust using rustup on a Red Hat Enterprise Linux 7.8 system which I am only accessing remotely.

In search of instructions, I'm always referred to this page: https://www.rust-lang.org/tools/install

However, when I open that page on my Windows laptop, it only shows me instructions for Windows and Windows Subsystem for Linux (WSL).

So I tried the instructions for WSL, which are

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

and they fail with:

info: downloading installer
Cannot execute /tmp/tmp.bFxBUYgNAJ/rustup-init (likely because of mounting /tmp as noexec).
Please copy the file to a location where you can execute binaries and run ./rustup-init.

Following the link about "other installation methods" just brings me back to the same page eventually.

Trying to redirect the curl output to a file and then running that file gives the same error message.

So, how do I install Rust?

Thanks!

Best, Oliver

Have you tried that?

I presume that is because you are running the command from /tmp. Run it somewhere you can execute code from.

If by "the file" they mean whatever curl downloads, then yes, I tried that. But it appears they mean some other file, and I don't know which file that would be.

I'm not running it from /tmp. Presumably the script does.

curl downloads a shell script (possibly confusingly called rustup-init.sh) which is piped into a shell, and that shell script downloads and runs rustup-init (different from rustup-init.sh)

You might find this documentation helpful: Other Installation Methods - Rust Forge

Oh, I got it. I just needed to move /tmp/tmp.bFxBUYgNAJ/rustup-init to somewhere else and then run it.

1 Like

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.