【问题标题】:How to install Cargo on a RHEL Linux server?如何在 RHEL Linux 服务器上安装 Cargo?
【发布时间】:2019-03-11 02:17:31
【问题描述】:

我尝试在 RHEL 服务器上安装 Cargo:

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

但完成后,我得到了回复:

cargo
-bash: cargo: command not found

有其他的安装方式吗?

【问题讨论】:

  • 您是否检查过脚本实际上将任何内容放到您的$PATH 上?它可能使用~/.local/bin 或其他一些非标准位置来存储二进制文件。
  • This 表示它将二进制文件放入~/.cargo/bin。是在你的$PATH 上吗?
  • source ~/.cargo/env 放入您的~/.bash_profile。它将~/.cargo/bin 附加到您的$PATH

标签: linux rust centos rhel rust-cargo


【解决方案1】:
  1. 首先启用rhel-7-variant-devtools-rpms 存储库

    subscription-manager repos --enable rhel-7-varient-devtools-rpms

    variant 替换为 Red Hat Enterprise Linux 系统变体(serverworkstation

  2. 启用rhel-variant-rhscl-7-rpms 存储库:

    subscription-manager repos --enable rhel-variant-rhscl-7-rpms

  3. 将 Red Hat Developer Tools 密钥添加到您的系统:

    cd /etc/pki/rpm-gpg

    wget -O RPM-GPG-KEY-redhat-devel https://www.redhat.com/security/data/a5787476.txt

    rpm --import RPM-GPG-KEY-redhat-devel

    将订阅附加到系统并启用存储库后,您可以安装 Red Hat Rust 工具集

  4. 然后安装rust-toolset-7

    yum install rust-toolset-7

    Cargo 由rust-toolset-7-cargo 包提供,并与rust-toolset-7 包一起自动安装。

【讨论】:

  • No package rust-toolset-7 available.
  • 请使用订阅管理器启用redhat开发者工具
猜你喜欢
  • 2021-06-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-07-28
  • 2016-08-11
  • 2018-01-23
相关资源
最近更新 更多