

cargo: no such subcommand: +nightly
source link: https://ma.ttias.be/cargo-no-such-subcommand-nightly/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

cargo: no such subcommand: +nightly
Mattias Geniar, November 23, 2020
Follow me on Twitter as @mattiasgeniar
I was trying to run the following command:
$ cargo +nightly install [package]
error: no such subcommand: `+nightly`
But … that didn’t work. This was my fix:
Remove Rust/Cargo from default package manager
I first removed the cargo
package I had installed via apt
from my system:
$ apt remove rustc rust-gdb libstd-rust-dev libstd-rust-1.43
This was on a rather old Ubuntu 18.04 LTS, so it had an outdated version of Rust/Cargo. To see which Rust packages you have installed, try this:
$ dpkg -l | grep -i rust
And see what packages come up with the name “rust” in them.
Install latest cargo release
From the official docs:
$ curl https://sh.rustup.rs -sSf | sh
Almost there!
Install package dependencies
But it still didn’t work straight away:
$ cargo +nightly install [package]
error: toolchain 'nightly-x86_64-unknown-linux-gnu' is not installed
Almost there! First, install the nightly toolchain using rustup
(which is now installed, thanks to the installer we ran above):
$ rustup toolchain install nightly
[...]
nightly-x86_64-unknown-linux-gnu installed - rustc 1.50.0-nightly (a0d664bae 2020-11-22)
Now, the +nightly
package install works:
$ cargo +nightly install [package]
[...]
Compiling rustc-hex v2.1.0
Compiling fake_instant v0.4.0
Compiling ansi_term v0.11.0
Compiling gimli v0.23.0
Compiling urlencoding v1.1.1
...
Building [=============> ] 107/411: ipnet, humantime, parity-wasm, object
(Note: I had to install pkg-config first before the cargo
install could compile the package.)
Want to subscribe to the cron.weekly newsletter?
I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.
It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.
No spam. Just some good, practical Linux & open source content.
Recommend
-
96
These Weeks in Firefox: Issue 25 Highlights A browser.tabs.tabMinWidth preference has been added to control the minimum tab width before overflow,
-
89
Highlights Prathiksha moved the pop-up blocked icon/menu from the urlbar to the identity block/identity pop-up (the notification bar for blocked popu...
-
114
Highlights Data preference c...
-
50
flagg - Barebones subcommand handling
-
133
GitHub is where people build software. More than 28 million people use GitHub to discover, fork, and contribute to over 79 million projects.
-
8
Profiler week 6/7: more experiments, and a `report` subcommand! Hello! I didn’t write a profiler blog post last week, but I am writing one today! The most exciting thing that happened in the last few weeks...
-
16
Copy link Contributor Author ehuss...
-
5
cargo-script cargo-script is a Cargo subcommand designed to let people quickly and easily run Rust "scripts" which can make use of Cargo's package ecosystem. It can also evaluate expressions and run filters...
-
5
add --explain subcommand #8952 Merged
-
3
Member ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK