Installation rust (cargo) in redhat 7


I try to install cargo in my redhat 7

i set this command yum install rust-toolset and i have this error :

Error: Package: rust-toolset-7-rust-1.26.2-3.el7.x86_64 (Cargo)
Requires: /usr/bin/cc
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

You have idea for i can install cargo please ?
Thanks in advance

1.26.2 is an extremely old and outdated version of rust. Almost no current crates will support it. I would recommend using the official rustup to install a current version of rust instead. Rust has extremely good backwards compatibility, so this can be done without worrying.

As to the actual error I have no idea, I haven't used any Rpm based distro for the past 20 years or so.

1 Like

Here the section from the official Rust homepage on how to use rustup to install Rust:

rust-toolset-7 is the original version we shipped in RHEL 7, with the SCL numbered like that to correspond to the devtoolset-7 at the time. Later we switched to Rust's own versions, so the latest available for RHEL 7 should be rust-toolset-1.66.

1.66 is still severely outdated and many modern packages won't compile on it. N-2 MSRV policy is quite common.

Additionally I would always recommend using rustup for the best developer experience, even on rolling release distros that can be expected to be up-to-date. For example, there is no supported way to run miri without access to a nightly toolchain as far as I know.

The better option that some distros have started doing is packaging rustup. Arch has done this for a while, but Debian also started doing so recently (couple of weeks ago, so only in testing/unstable as of writing).

A post was split to a new topic: Trouble installing Rust, "rustup could not choose a version of cargo to run"

@Testingsh000 please don’t spam post the same reply multiple times. Please consider opening a new topic for a new unrelated question. Please don’t unnecessarily ping individuals with follow-up requests that are unrelated (i.e. not a response) to their concrete answer.

(For this question, I have now deduplicated and moved it into a new topic myself.)

1 Like