1. 安裝 Windows Subsystem for Linux
以系統管理員身分開啟 PowerShell, 執行下列 command:2. 安裝 Ubuntu 18.04 LTS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
系統會提示你重新開機。
在此下載、安裝:3. 初始化
Ubuntu 18.04 LTS
Ubuntu 需要 Microsoft Store 才能安裝,如果你之前把 Microsoft Store 移除了,需以系統管理員身分開啟 PowerShell, 執行下列 command 重新安裝:完成這個步驟大約會占用 200MB 儲存空間。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Get-AppXPackage *WindowsStore* -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
第一次執行 Ubuntu 18.04 LTS 時,會進行初始化,並建立 Linux user account。4. 更新 packages
完成這個步驟大約會占用 600MB 儲存空間。
執行下列 command:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
sudo apt update && sudo apt upgrade
完成這個步驟大約會占用 700MB 儲存空間。
延伸閱讀
[Microsoft] 適用於 Linux 的 Windows 子系統文件
[Microsoft] Learn About Windows Console & Windows Subsystem For Linux (WSL)
[The Will Will Web] 介紹好用工具:WSL (Windows Subsystem for Linux)
[The Will Will Web] 我的 Windows Subsystem for Linux (WSL) 終極開發人員配置 - 2018 版
How to Mount Removable Drives and Network Locations in the Windows Subsystem for Linux
How to Uninstall and Reset Windows Subsystem for Linux Distributions