|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: Other Installation Methods · The Rust Programming Language |
| 4 | +--- |
| 5 | + |
| 6 | +# Other Rust Installation Methods |
| 7 | + |
| 8 | +- [Which installer should you use?](#which) |
| 9 | +- [Other ways to install `rustup`](#more-rustup) |
| 10 | +- [Standalone installers](#standalone) |
| 11 | +- [Source code](#source) |
| 12 | + |
| 13 | +## Which installer should you use? |
| 14 | +<span id="which"></span> |
| 15 | + |
| 16 | +Rust runs on many platforms, and there are many ways to install Rust. If you |
| 17 | +want to install Rust in the most straightforward, recommended way, then follow |
| 18 | +the instructions on the main [installation page]. |
| 19 | + |
| 20 | +That page describes installation via [`rustup`], a tool that manages multiple |
| 21 | +Rust toolchains in a consistent way across all platforms Rust supports. Why |
| 22 | +might one _not_ want to install using those instructions? |
| 23 | + |
| 24 | +- Offline installation. `rustup` downloads components from the internet on |
| 25 | + demand. If you need to install Rust without access to the internet, `rustup` |
| 26 | + is not suitable. |
| 27 | +- Preference for the system package manager. On Linux in particular, but also on |
| 28 | + macOS with [Homebrew], and Windows with [Chocolatey], developers sometimes |
| 29 | + prefer to install Rust with their platform's package manager. |
| 30 | +- Preference against `curl | sh`. On Unix, we usually install `rustup` by |
| 31 | + running a shell script via `curl`. Some have concerns about the security of |
| 32 | + this arrangement and would prefer to download and run the installer |
| 33 | + themselves. |
| 34 | +- Validating signatures. Although `rustup` performs its downloads over HTTPS, |
| 35 | + the only way to verify the signatures of Rust installers today is to do so |
| 36 | + manually with the standalone installers. |
| 37 | +- GUI installation and integration with "Add/Remove Programs" on |
| 38 | + Windows. `rustup` runs in the console and does not register its installation |
| 39 | + like typical Windows programs. If you prefer a more typical GUI installation |
| 40 | + on Windows there are standalone `.msi` installers. In the future |
| 41 | + `rustup` will also have a GUI installer on Windows. |
| 42 | + |
| 43 | +Rust's platform support is defined in [three tiers], which correspond closely |
| 44 | +with the installation methods available: in general, the Rust project provides |
| 45 | +binary builds for all tier 1 and tier 2 platforms, and they are all installable |
| 46 | +via `rustup`. Some tier 2 platforms though have only the standard library |
| 47 | +available, not the compiler itself; that is, they are cross-compilation targets |
| 48 | +only; Rust code can run on those platforms, but they do not run the compiler |
| 49 | +itself. Such targets can be installed with the `rustup target add` command. |
| 50 | + |
| 51 | +## Other ways to install `rustup` |
| 52 | +<span id="rustup"></span> |
| 53 | + |
| 54 | +The way to install `rustup` differs by platform: |
| 55 | + |
| 56 | +* On Unix, run `curl https://sh.rustup.rs -sSf | sh` in your |
| 57 | + shell. This downloads and runs [`rustup-init.sh`], which in turn |
| 58 | + downloads and runs the correct version of the `rustup-init` |
| 59 | + executable for your platform. |
| 60 | +* On Windows, download and run [`rustup-init.exe`]. |
| 61 | + |
| 62 | +`rustup-init` can be configured interactively, and all options can additionally |
| 63 | +be controlled by command-line arguments, which can be passed through the shell |
| 64 | +script. Pass `--help` to `rustup-init` as follows to display the arguments |
| 65 | +`rustup-init` accepts: |
| 66 | + |
| 67 | +``` |
| 68 | +curl https://sh.rustup.rs -sSf | sh -s -- --help |
| 69 | +``` |
| 70 | + |
| 71 | +If you prefer not to use the shell script, you may directly download |
| 72 | +`rustup-init` for the platform of your choice: |
| 73 | + |
| 74 | +<div class="rustup-init-table"> |
| 75 | + {% for column in site.data.platforms.rustup %} |
| 76 | + <div> |
| 77 | + {% for target in column %} |
| 78 | + {% if target contains 'windows' %} |
| 79 | + <a href="https://static.rust-lang.org/rustup/dist/{{ target }}/rustup-init.exe"> |
| 80 | + {{ target }} |
| 81 | + </a> |
| 82 | + {% else %} |
| 83 | + <a href="https://static.rust-lang.org/rustup/dist/{{ target }}/rustup-init"> |
| 84 | + {{ target }} |
| 85 | + </a> |
| 86 | + {% endif %} |
| 87 | + {% endfor %} |
| 88 | + </div> |
| 89 | + {% endfor %} |
| 90 | +</div> |
| 91 | + |
| 92 | +## Standalone installers |
| 93 | +<span id="standalone"></span> |
| 94 | + |
| 95 | +The official Rust standalone installers contain a single release of Rust, and |
| 96 | +are suitable for offline installation. They come in three forms: tarballs |
| 97 | +(extension `.tar.gz`), that work in any Unix-like environment, Windows |
| 98 | +installers (`.msi`), and Mac installers (`.pkg`). These installers come with |
| 99 | +`rustc`, `cargo`, `rustdoc`, the standard library, and the standard |
| 100 | +documentation, but do not provide access to additional cross-targets like |
| 101 | +`rustup` does. |
| 102 | + |
| 103 | +The most common reasons to use these are: |
| 104 | + |
| 105 | +- Offline installation |
| 106 | +- Prefering a more platform-integrated, graphical installer on Windows |
| 107 | + |
| 108 | +Each of these binaries is signed with the [Rust signing key], which is |
| 109 | +[available on keybase.io], by the Rust build infrastructure, with |
| 110 | +[GPG]. In the tables below, the `.asc` files are the signatures. |
| 111 | + |
| 112 | +Past releases can be found in [the archives]. |
| 113 | + |
| 114 | +{% for channel in site.channels %} |
| 115 | + |
| 116 | +### {{ channel.name | capitalize }} ({{ channel.vers }}) |
| 117 | +<span id="{{ channel.name }}"></span> |
| 118 | + |
| 119 | +<div class="installer-table {{ channel.name }}"> |
| 120 | + {% for column in site.data.platforms[channel.name] %} |
| 121 | + <div> |
| 122 | + {% for target in column %} |
| 123 | + <div> |
| 124 | + <span>{{ target }}</span> |
| 125 | + <a href="https://static.rust-lang.org/dist/rust-{{ channel.package }}-{{ target }}.tar.gz">.tar.gz</a> |
| 126 | + <a href="https://static.rust-lang.org/dist/rust-{{ channel.package }}-{{ target }}.tar.gz.asc">.asc</a> |
| 127 | + </div> |
| 128 | + {% if target contains 'windows' %} |
| 129 | + <div> |
| 130 | + <span>{{ target }}</span> |
| 131 | + <a href="https://static.rust-lang.org/dist/rust-{{ channel.package }}-{{ target }}.msi">.msi</a> |
| 132 | + <a href="https://static.rust-lang.org/dist/rust-{{ channel.package }}-{{ target }}.msi.asc">.asc</a> |
| 133 | + </div> |
| 134 | + {% elsif target contains 'darwin' %} |
| 135 | + <div> |
| 136 | + <span>{{ target }}</span> |
| 137 | + <a href="https://static.rust-lang.org/dist/rust-{{ channel.package }}-{{ target }}.pkg">.pkg</a> |
| 138 | + <a href="https://static.rust-lang.org/dist/rust-{{ channel.package }}-{{ target }}.pkg.asc">.asc</a> |
| 139 | + </div> |
| 140 | + {% endif %} |
| 141 | + {% endfor %} |
| 142 | + </div> |
| 143 | + {% endfor %} |
| 144 | +</div> |
| 145 | + |
| 146 | +{% endfor %} |
| 147 | + |
| 148 | +## Source code |
| 149 | +<span id="source"></span> |
| 150 | + |
| 151 | +<div class="installer-table"> |
| 152 | + <div> |
| 153 | + <div> |
| 154 | + <span>Stable</span> |
| 155 | + <a href="https://static.rust-lang.org/dist/rustc-{{ site.stable }}-src.tar.gz">.tar.gz</a> |
| 156 | + <a href="https://static.rust-lang.org/dist/rustc-{{ site.stable }}-src.tar.gz.asc">.asc</a> |
| 157 | + </div> |
| 158 | + </div> |
| 159 | + <div> |
| 160 | + <div> |
| 161 | + <span>Beta</span> |
| 162 | + <a href="https://static.rust-lang.org/dist/rustc-beta-src.tar.gz">.tar.gz</a> |
| 163 | + <a href="https://static.rust-lang.org/dist/rustc-beta-src.gz.asc">.asc</a> |
| 164 | + </div> |
| 165 | + </div> |
| 166 | + <div> |
| 167 | + <div> |
| 168 | + <span>Nightly</span> |
| 169 | + <a href="https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz">.tar.gz</a> |
| 170 | + <a href="https://static.rust-lang.org/dist/rustc-nightly-src.tar.gz.asc">.asc</a> |
| 171 | + </div> |
| 172 | + </div> |
| 173 | +</div> |
| 174 | + |
| 175 | +[installation page]: install.html |
| 176 | +[`rustup`]: https://github.com/rust-lang-nursery/rustup.rs |
| 177 | +[other-rustup]: https://github.com/rust-lang-nursery/rustup.rs#other-installation-methods |
| 178 | +[`rustup-init.exe`]: https://static.rust-lang.org/rustup/dist/i686-pc-windows-gnu/rustup-init.exe |
| 179 | +[`rustup-init.sh`]: https://static.rust-lang.org/rustup/rustup-init.sh |
| 180 | +[Homebrew]: http://brew.sh/ |
| 181 | +[Chocolatey]: http://chocolatey.org/ |
| 182 | +[three tiers]: https://forge.rust-lang.org/platform-support.html |
| 183 | +[Rust signing key]: https://static.rust-lang.org/rust-key.gpg.ascii |
| 184 | +[GPG]: https://gnupg.org/ |
| 185 | +[available on keybase.io]: https://keybase.io/rust |
| 186 | +[the archives]: https://static.rust-lang.org/dist/index.html |
| 187 | + |
0 commit comments