Install the .net core 6.0 operating environment in windows10 wsl
environment
- wsl Free 18.04
- .net 6.0
Relevant information
- dotnet-sdk list
- download dotnet-sdk-6
- Install .NET on Linux using the install script or by extracting the binaries
Manually install dotnet-sdk in the wsl environment
- Download sdk dotnet-sdk-6.0.100-linux-x64.tar.gz for Ubuntu
- Save to E:\downloads\dotnet-sdk-6.0.302-linux-x64.tar.gz
- Open cmd and enter the command: wsl to enter the default linux release version (local wsl defaults to Ubuntu 18.04)
- Create working directory /home/dotnet
- Copy the binary file to wsl and execute the command:
- cp E:\downloads\dotnet-sdk-6.0.302-linux-x64.tar.gz /home/dotnet/dotnet-sdk-6.0.302-linux-x64.tar.gz
- Create working directory /home/dotnet/.dotnet
- Unzip the sdk file
- tar zxf “/home/dotnet/dotnet-sdk-6.0.302-linux-x64.tar.gz” -C “/home/dotnet/.dotnet”
- Configure environment variables
- Add the following two lines to the ~/.profile file
- export DOTNET_ROOT=/home/dotnet/.dotnet
- export PATH= P A T H : PATH: PATH:DOTNET_ROOT
- Make the configuration take effect
- source .profile
- Add the following two lines to the ~/.profile file
- Verify that the installation was successful
- dotnet --list-sdks
- dotnet --list-runtimes
> dotnet --list-sdks
6.0.302 [/home/dotnet/.dotnet/sdk]
> dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.7 [/home/dotnet/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.7 [/home/dotnet/.dotnet/shared/Microsoft.NETCore.App]
Summarize:
Wsl needs to access the local disk from the mount point, which is /mnt/e, where e is the drive letter of the local disk. Knowing the mount point, you can exchange files between wsl and windows arbitrarily.