Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I install Rust using rustup on Windows when behind a firewall?

Tags:

proxy

rust

I downloaded rustup-init.exe. When I ran it at home, everything went fine, but when I run it from my office through a proxy, I ran into a problem:

info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to 'C:\Users\350627\.rustup\tmp\l3ogei4e89gnb1df_file
info: caused by: error during download
info: caused by: [6] Couldn't resolve host name (Couldn't resolve host 'static.rust-lang.org')

I am on Windows and the http_proxy environment variable is properly set.

I tried to "customize installation", but it did not give me the option to manually provide an IP address:

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation

Does anyone know a workaround?

like image 241
Peter Pei Guo Avatar asked Mar 16 '17 19:03

Peter Pei Guo


People also ask

How do I install Rust on Windows?

If you are running Windows, download and run rustup‑init.exe then follow the on-screen instructions. If you are running Windows, download and run rustup‑init.exe then follow the on-screen instructions.

Does Rustup install cargo?

rustup installs rustc , cargo , rustup and other standard tools to Cargo's bin directory.

What is Rustup in Rust?

Rustup can be used to install Rust and keep it updated. It also allows you to seamlessly switch between the stable, beta, and nightly Rust compilers and tooling.


1 Answers

I followed aSpex's advice...

  1. Go to https://www.rust-lang.org/ -> Install
  2. Download rustup-init.exe to ~/Downloads

  3. In powershell:

    $proxy='http://<IP>:<PORT>'
    
    $ENV:HTTP_PROXY=$proxy 
    $ENV:HTTPS_PROXY=$proxy
    cd ~\Downloads
    .\rustup-init.exe
    
like image 127
Jim Burger Avatar answered Sep 24 '22 06:09

Jim Burger