rust-lang / rust-lang/rustup

error: 'cargo' is not installed for the toolchain 'stable-x86_64-unknown-linux-gnu'

Open
#2,701 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

not-rustup question
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
22h 40m
Merged PRs (30d)
46

Description

Problem
When I use "curl - SSF" https://sh.rustup.rs |After sh "installation, the corresponding cargo module has been installed, but it will report an error when I query the cargo version information or other software needs to call it

Steps

1.curl - SSF" https://sh.rustup.rs |After sh
2.Adopt default installation scheme
3.cargo --version

The specific error reporting information is as follows:
[root@racknerd-acba13 ~]# cargo --version
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
error: 'cargo' is not installed for the toolchain 'stable-x86_64-unknown-linux-gnu'
To install, run rustup component add cargo
[root@racknerd-acba13 ~]# rustup component add cargo
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
error: toolchain 'stable-x86_64-unknown-linux-gnu' does not support components
[root@racknerd-acba13 ~]# cd /root/.cargo/bin
[root@racknerd-acba13 bin]# ./cargo --version
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
error: 'cargo' is not installed for the toolchain 'stable-x86_64-unknown-linux-gnu'
To install, run rustup component add cargo

Notes

Output of rustup --version:
[root@racknerd-acba13 ~]# rustup --version
rustup 1.23.1 (3df2264a9 2020-11-30)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
info: The currently active rustc version is (rustc does not exist)
Output of rustup show:
[root@racknerd-acba13 ~]# rustup show
Default host: x86_64-unknown-linux-gnu
rustup home: /root/.rustup

info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2021-03-25, rust version 1.51.0 (2fd73fabe 2021-03-23)
stable-x86_64-unknown-linux-gnu (default)
(rustc does not exist)

The system environment is CentOS 7.9.2009 (py3.7.9)

If you need any feedback, please leave me a message. Thank you very much for your help and look forward to your reply
Here is a partial screenshot:
QQ截图20210326105532
QQ截图20210326103545
QQ截图20210326103308

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported curl https://sh.rustup.rs | sh, cargo --version, rustup component add cargo, and rustup show commands on the stated CentOS 7.9 environment. Trace how the default stable toolchain is selected and why it reports that rustc and cargo are absent; done means the default installation provides a usable cargo command or clearly reports the supported recovery path.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.