无法使用 curl 在 RHEL 6.10 上安装 Rust
Cannot install Rust on RHEL 6.10 using curl
我正在尝试使用 curl 在 RHEL 6.10 上安装 rust 1.48 并收到以下错误
info: downloading installer
Cannot execute /tmp/tmp.ShsTMGuMqK/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.
这是我安装 rust 的命令
curl --insecure -sSf -o $HOME/rust/rustup-init https://sh.rustup.rs
chmod +x $HOME/rust/rustup-init
./$HOME/rust/rustup-init -s -y --default-toolchain 1.48
我发现了这个 https://github.com/rust-lang/rust/issues/39771 但它没有用。我的 $HOME 目录也有写权限
错误信息看起来很清楚,但你似乎误解了它:sh.rustup.sh
downloads rustup-init (to $TMP
) 然后执行它。在您的系统上它无法执行它,因为您的 TMP 已挂载为 noexec。
以不同的名称下载 sh.rustup.sh
不会更改脚本的内容,它仍然会下载实际的 rustup-init
并尝试 运行 它,但会失败再次.
你应该做的就是错误消息告诉你的确切内容: move/copy /tmp/tmp.ShsTMGuMqK/rustup-init
(它下载的 rustup-init) 然后到你家运行那个。
根据@Masklinn 的回答,如果你已经保护了 tmp,你可以使用这两行以无人值守的方式安装 rustup-init(不要问任何问题):
sce=$(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s 2>&1 | grep 'because of mounting \/tmp' | awk '{ print }') | cp "${sce}" ~/rustup-init
~/./rustup-init -y
我正在尝试使用 curl 在 RHEL 6.10 上安装 rust 1.48 并收到以下错误
info: downloading installer
Cannot execute /tmp/tmp.ShsTMGuMqK/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.
这是我安装 rust 的命令
curl --insecure -sSf -o $HOME/rust/rustup-init https://sh.rustup.rs
chmod +x $HOME/rust/rustup-init
./$HOME/rust/rustup-init -s -y --default-toolchain 1.48
我发现了这个 https://github.com/rust-lang/rust/issues/39771 但它没有用。我的 $HOME 目录也有写权限
错误信息看起来很清楚,但你似乎误解了它:sh.rustup.sh
downloads rustup-init (to $TMP
) 然后执行它。在您的系统上它无法执行它,因为您的 TMP 已挂载为 noexec。
以不同的名称下载 sh.rustup.sh
不会更改脚本的内容,它仍然会下载实际的 rustup-init
并尝试 运行 它,但会失败再次.
你应该做的就是错误消息告诉你的确切内容: move/copy /tmp/tmp.ShsTMGuMqK/rustup-init
(它下载的 rustup-init) 然后到你家运行那个。
根据@Masklinn 的回答,如果你已经保护了 tmp,你可以使用这两行以无人值守的方式安装 rustup-init(不要问任何问题):
sce=$(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s 2>&1 | grep 'because of mounting \/tmp' | awk '{ print }') | cp "${sce}" ~/rustup-init
~/./rustup-init -y