--Learn how to install WSL (Windows Subsystem for Linux) on Windows 10 under a proxy environment
--For those who want to install WSL in Windows 10 environment under proxy environment
Change Windows 10 settings and enable WSL
Start the control panel.
Click "Programs".
Click "Turn Windows features on or off".
Check the "Windows Subsystem for Linux" item, click OK, and then restart your PC.
Install WSL
Click the Windows button and click "Microsoft Store".
Type "Ubunu" in the search window and press Enter.
Click "Ubuntu 18.04" in the search results. * The author says "installed", but this is not originally stated.
Click "Get".
Wait for the installation to complete.
When the installation is complete, the "Start" button will appear on the Microsoft Store screen. Click it.
Wait for the screen below to appear.
Setup
Enter the user name when the screen below is displayed. Press Enter after completing the input.
Enter the password when the screen below appears. Press Enter after completing the input.
When the screen below appears, use the same password as before. Press Enter after completing the input.
Setup is complete when the screen below is displayed.
Proxy address setting
Execute the following command to create an apt configuration file.
```terminal
$ sudo vi /etc/apt/apt.conf
```
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";
```
Execute the following command to open the proxy address in the wget configuration file.
```terminal
$ sudo vi /etc/wgetrc
```
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
```
Execute the following command to open the file that sets the environment variables.
```terminal
$ vi .bashrc
```
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".
1."Simple edit mode" "Ctrl"+Shift+C/Copy V/Check "Use as paste" and click "OK".
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 ```
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
```
1.Installation is complete when the update is complete!
Recommended Posts