您好,登錄后才能下訂單哦!
之前聽說Windows 10上面可以裝Linux了,一時興起,就搗鼓了起來,長時間不用了,結(jié)果又忘記root密碼。哎,老了,記不住事情了。所以就上網(wǎng)查了一下如何卸載Linux子系統(tǒng),再寫一篇筆記吧,免得以后又忘記了。
打開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子系統(tǒng)了。
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已經(jīng)被卸載。
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,本機(jī)電腦沒有權(quán)限?查了一下,我確實沒有admin權(quán)限。但是我重試了一下,結(jié)果這次成功了。
不過又在網(wǎng)上查了一下,如果你重試了,還是不行,請參考下面的方法有可能解決你的安裝失敗問題:
在下面的啟用或關(guān)閉Windows功能里啟用適用于Linux的Windows子系統(tǒng),然后再試一遍吧。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。