Install WSL
Step 1: Enter the control panel to open the program and function page, choose to enable or disable the Windows function
Step 2: Turn on "Windows Subsystem for Linux"
This process requires networking to update and install some components, and then restart the system to enter the next step.
Step 3: After restarting, enter the Microsoft App Store application, search for Linux, select the distribution you want to use and install
I chose Ubuntu 20.04 LTS, the long-term support version of Ubuntu. Stable and easy to use.
After the installation is complete, click the icon to open for initial configuration, such as user name and password settings, you can start using it.
Configure WSL
After WSL is installed, you need to change the software source to increase the speed of downloading and installing software packages. The default source access is very slow. You can use some domestic mirror sites to improve the speed, such as using Tsinghua sources, Tencent Cloud sources, Alibaba Cloud sources or NetEase sources, etc. Here, Tsinghua sources are used.
Visit the website of Tsinghua Source : Ubuntu's help page in Tsinghua Source.
Open the WSL input sudo apt edit-sources
to modify the source. The first time you enter, you will be prompted to select a text editor such as nano or vim. The default is nano, just enter. You can delete all sources in the file or comment out, and use # for comments.
Then copy the following piece of code into it.
Save and exit, ctrl x during nano operation and then press enter
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse