您好,登錄后才能下訂單哦!
之前聽說Windows 10上面可以裝Linux了,一時興起,就搗鼓了起來,長時間不用了,結果又忘記root密碼。哎,老了,記不住事情了。所以就上網查了一下如何卸載Linux子系統,再寫一篇筆記吧,免得以后又忘記了。
打開CMD,輸入lxrun,就會提示這條命令的使用方法,見下:
C:\Users\admin>lxrun
Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
Usage:
/install - Installs the subsystem
Optional arguments:
/y - Do not prompt user to accept or create a subsystem user
/uninstall - Uninstalls the subsystem
Optional arguments:
/full - Perform a full uninstall
/y - Do not prompt user to confirm
/setdefaultuser - Sets the default subsystem user. If the user account does not exist it will be created.
Optional arguments:
username - Supply the username
/y - If username is supplied, do not prompt to create a password
輸入:lxrun /uninstall 就可以開始卸載原來的Linux子系統了。
C:\Users\admin>lxrun /uninstall
Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
This will uninstall Ubuntu on Windows.
This will remove the Ubuntu environment as well as any modifications and new applications with the exception of:
C:\Users\admin\AppData\Local\lxss\home
C:\Users\admin\AppData\Local\lxss\root
Type "y" to continue: y
Uninstalling...
再輸入bash查看一下,驗證Ubuntu已經被卸載。
C:\Users\admin>bash
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
Press any key to continue...
接下來安裝Ubuntu Linux,輸入命令:lxrun /install
C:\Users\admin>lxrun /install
Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
This will install Ubuntu on Windows, distributed by Canonical and licensed under its terms available here:
https://aka.ms/uowterms
Type "y" to continue: y
Downloading from the Microsoft Store... 100%
Extracting filesystem, this will take a few minutes...
Error: 0x800706ba
擦,有Error,本機電腦沒有權限?查了一下,我確實沒有admin權限。但是我重試了一下,結果這次成功了。
不過又在網上查了一下,如果你重試了,還是不行,請參考下面的方法有可能解決你的安裝失敗問題:
在下面的啟用或關閉Windows功能里啟用適用于Linux的Windows子系統,然后再試一遍吧。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。