问题
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:
First enable the
rhel-7-variant-devtools-rpms
repositorysubscription-manager repos --enable rhel-7-varient-devtools-rpms
Replace
variant
with the Red Hat Enterprise Linux system variant (server
orworkstation
)Enable the
rhel-variant-rhscl-7-rpms
repository:subscription-manager repos --enable rhel-variant-rhscl-7-rpms
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
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 therust-toolset-7
package.
来源:https://stackoverflow.com/questions/55071283/how-to-install-cargo-on-a-rhel-linux-server