[LINUX] Introducing WSL (Ubuntu 18.04) to WIndows10 ~ Proxy environment second part ~

Purpose

--Learn how to install WSL (Windows Subsystem for Linux) on Windows 10 under a proxy environment

Target of this article

--For those who want to install WSL in Windows 10 environment under proxy environment

Work outline

  1. Change Windows 10 settings and enable WSL
  2. Install WSL
  3. Setup
  4. Proxy address setting
  5. Update to the latest state

Work details

  1. Change Windows 10 settings and enable WSL

  2. Start the control panel.

  3. Click "Programs". WSL_01.png

  4. Click "Turn Windows features on or off". WSL_02.png

  5. Check the "Windows Subsystem for Linux" item, click OK, and then restart your PC. WSL_03.png

  6. Install WSL

  7. Click the Windows button and click "Microsoft Store". WSL_04.png

  8. Type "Ubunu" in the search window and press Enter.

  9. Click "Ubuntu 18.04" in the search results. * The author says "installed", but this is not originally stated. WSL_05.png

  10. Click "Get". WSL_06.png

  11. Wait for the installation to complete. WSL_07.png

  12. When the installation is complete, the "Start" button will appear on the Microsoft Store screen. Click it. WSL_08.png

  13. Wait for the screen below to appear. WSL_09.png

  14. Setup

  15. Enter the user name when the screen below is displayed. Press Enter after completing the input. WSL_10.png

  16. Enter the password when the screen below appears. Press Enter after completing the input. WSL_11.png

  17. When the screen below appears, use the same password as before. Press Enter after completing the input. WSL_12.png

  18. Setup is complete when the screen below is displayed. WSL_13.png

  19. Proxy address setting

  20. Execute the following command to create an apt configuration file.

    ```terminal
    $ sudo vi /etc/apt/apt.conf
    ```
    
  21. Write the following contents in the file opened by the above command.

    ```text
    Acquire::ftp::proxy "Proxy address";
    Acquire::http::proxy "Proxy address";
    Acquire::https::proxy "Proxy address";
    ```
    
  22. Execute the following command to open the proxy address in the wget configuration file.

    ```terminal
    $ sudo vi /etc/wgetrc
    ```
    
  23. Modify the file opened by the above command as described below.

    ```text
    # You can set the default proxies for Wget to use for http, https, and ftp.
    # They will override the value in the environment.
    #https_proxy = http://proxy.yoyodyne.com:18023/
    #http_proxy = http://proxy.yoyodyne.com:18023/
    #ftp_proxy = http://proxy.yoyodyne.com:18023/
    https_proxy =Proxy address#Add this line
    http_proxy =Proxy address#Add this line
    ftp_proxy =Proxy address#Add this line
    
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    # If you do not want to use proxy at all, set this to off.
    #use_proxy = on
    use_proxy = on             #Add this line
    ```
    
  24. Execute the following command to open the file that sets the environment variables.

    ```terminal
    $ vi .bashrc
    ```
    
  25. Add the following contents to the last line of the configuration file opened by executing the above command.

    ```terminal
    export ftp_proxy="Proxy address"
    export http_proxy="Proxy address"
    export https_proxy="Proxy address"
    

1.Update to the latest state 1.Right-click the band part of the Ubuntu command window and click "Properties". WSL_14.png
1."Simple edit mode" "Ctrl"+Shift+C/Copy V/Check "Use as paste" and click "OK". WSL_15.png 1.Execute the following command to switch the server connection destination to the Japanese server. After execution, you will be prompted to enter the password you set earlier, so enter it and press Enter.

```
$ sudo sed -i -e 's%http://.*.ubuntu.com%http://ftp.jaist.ac.jp/pub/Linux%g' /etc/apt/sources.list

[sudo] password for username: #Enter password and Enter ``` WSL_16.png

1.Execute the following command to update Ubuntu. * Y as shown below/When n is displayed, enter Y and press Enter.

```
$ sudo apt update
$ sudo apt upgrade
```

WSL_18.png

1.Installation is complete when the update is complete! WSL_19.png

Recommended Posts

Introducing WSL (Ubuntu 18.04) to WIndows10 ~ Proxy environment second part ~
I tried to build an environment with WSL + Ubuntu + VS Code in a Windows environment
How to set up Ubuntu for Windows Subsystem for Linux 2 (WSL2)
Pip install (Windows) under Proxy environment
Modify Ubuntu tofu to Japanese environment
WSL2 ~ Linux on Windows ~ (Part 1: Introduction)
Bring files in Windows to WSL
From Ubuntu 20.04 introduction to environment construction
Steps to build a Django environment with Win10 WSL Ubuntu18.04 + Anaconda + Apache2
Introducing Slurm Workload Manager to Ubuntu 18.04 LTS
Steps to install Python environment on Ubuntu
Introduction to docker Create ubuntu environment in ubuntu
[Latest] How to build Java environment on Ubuntu
How to use pip3 under proxy environment Note
To you who develop Python under Windows & proxy
How to build Java environment on Ubuntu (Linux)
[TF] How to build Tensorflow in Proxy environment