@@ -451,6 +451,36 @@ $ rustup target add i686-pc-windows-gnu
451
451
[ MinGW/MSYS2 toolchain ] : https://msys2.github.io/
452
452
[ vs ] : https://www.visualstudio.com/downloads
453
453
454
+ ## Working with distribution Rust packages
455
+
456
+ Several Linux distributions package Rust, and you may wish to use the packaged
457
+ toolchain, such as for distribution package development. You may also wish to
458
+ use a rustup-managed toolchain such as nightly or beta. Normally, rustup will
459
+ complain that you already have Rust installed in /usr and refuse to install.
460
+ However, you can install Rust via Rustup and have it coexist with your
461
+ distribution's packaged Rust.
462
+
463
+ When you initially install Rust with rustup, pass the ` -y ` option to make it
464
+ ignore the packaged Rust toolchain and install a rustup-managed toolchain into
465
+ ` ~/.cargo/bin ` . Add that directory to your ` $PATH ` (or let rustup do it for you
466
+ by not passing ` --no-modify-path ` ). Then, to tell rustup about your system
467
+ toolchain, run:
468
+
469
+ ```
470
+ rustup toolchain link system /usr
471
+ ```
472
+
473
+ You can then use +system as a rustup toolchain, just like +nightly; for
474
+ instance, you can run cargo +system build to build with the system toolchain,
475
+ or cargo +nightly build to build with nightly.
476
+
477
+ If you do distribution Rust development, you should likely make +system your
478
+ default toolchain:
479
+
480
+ ```
481
+ rustup default system
482
+ ```
483
+
454
484
## Working with custom toolchains and local builds
455
485
456
486
For convenience of developers working on Rust itself, ` rustup ` can manage
0 commit comments