How to install Cargo on a RHEL Linux server?

喜夏-厌秋 提交于 2019-12-31 07:41:33

问题


I tried installing Cargo on a RHEL server with:

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

but after finishing, I get the response:

cargo
-bash: cargo: command not found

Is there a different way to install?


回答1:


  1. First enable the rhel-7-variant-devtools-rpms repository

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

    Replace variant with the Red Hat Enterprise Linux system variant (server or workstation)

  2. Enable the rhel-variant-rhscl-7-rpms repository:

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

  3. Add the Red Hat Developer Tools key to your system:

    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

    Once the subscription is attached to the system and repositories enabled, you can install Red Hat Rust Toolset

  4. Then install rust-toolset-7

    yum install rust-toolset-7

    Cargo is provided by the rust-toolset-7-cargo package and is automatically installed with the rust-toolset-7 package.



来源:https://stackoverflow.com/questions/55071283/how-to-install-cargo-on-a-rhel-linux-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!