linux装完windows时间长,重装Windows 10上的Linux子系统
之前聽(tīng)說(shuō)Windows 10上面可以裝Linux了,一時(shí)興起,就搗鼓了起來(lái),長(zhǎng)時(shí)間不用了,結(jié)果又忘記root密碼。哎,老了,記不住事情了。所以就上網(wǎng)查了一下如何卸載Linux子系統(tǒng),再寫一篇筆記吧,免得以后又忘記了。
打開CMD,輸入lxrun,就會(huì)提示這條命令的使用方法,見(jiàn)下:
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 就可以開始卸載原來(lái)的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查看一下,驗(yàn)證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...
接下來(lái)安裝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ī)電腦沒(méi)有權(quán)限?查了一下,我確實(shí)沒(méi)有admin權(quán)限。但是我重試了一下,結(jié)果這次成功了。
不過(guò)又在網(wǎng)上查了一下,如果你重試了,還是不行,請(qǐng)參考下面的方法有可能解決你的安裝失敗問(wèn)題:
在下面的啟用或關(guān)閉Windows功能里啟用適用于Linux的Windows子系統(tǒng),然后再試一遍吧。
總結(jié)
以上是生活随笔為你收集整理的linux装完windows时间长,重装Windows 10上的Linux子系统的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: linux内核支持utf8,Linux对
- 下一篇: linux下运行lua,linux下配置