0%

enable WSL on Windows 10 and install Ubuntu 16.04 Ubuntu 18.04

WLS for windows

  • Enable WSL for Windows
1
2
3
4
5
6
# start powershell as admin
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

# or by 控制面板的"启动或关闭Windows功能"

#重启电脑
  • Microsoft Store - Search Ubuntu16.04/Ubuntu18.04 and Install
  • CMD+R \wsl$
  • VS Code + WSL Bash (CMD,Powershell)

windows 10 配置默认Linux发行版本

1
2
3
4
5
6
7
8
cmd> wsl
cmd> wslconfig /l
Ubuntu-16.04(默认)
Ubuntu-18.04

cmd> wslconfig /s Ubuntu-18.04
Ubuntu-18.04(默认)
Ubuntu-16.04

卸载WSL Ubuntu 16.04

1
2
3
4
5
# Windows Search ---- Ubuntu 16.04 LTS --- 菜单选择卸载

# check if uninstall successfully
cmd> wslconfig /s Ubuntu-18.04
Ubuntu-18.04(默认)

Reference

History

  • 2020/3/20: created.