如何在Windows上重置我的Ubuntu安装?


21

我已经在计算机上安装了Windows的Linux子系统。它工作得很漂亮!

从那时起,我在安装过程中完成了许多难以置信的事情。不再有效。如何从头开始?


这不再是推荐的方法。PS C:\ IaC> lxrun / uninstall警告:lxrun.exe仅用于为Linux发行版配置旧版Windows子系统。可以通过访问Windows商店来安装发行版:aka.ms/wslstore
John Miller

Answers:


7

您可以从设置中重置Ubuntu,只需在开始菜单中找到它,右键单击以转到App settings,然后按reset按钮。

在开始时找到ubuntu

从设置重置


该死的..没想到会那么简单!
Shishir Gupta


6

使用特定于发行版的新商店应用程序,例如

C:\> ubuntu /?
Launches or configures a linux distribution.

Usage:
    <no args>
      - Launches the distro's default behavior. By default, this launches your default shell.

...

    clean
      - Uninstalls the distro. The appx remains on your machine. This can be
        useful for "factory resetting" your instance. This removes the linux
        filesystem from the disk, but not the app from your PC, so you don't
        need to redownload the entire tar.gz again.

所以,ubuntu clean应该足够了。

如果ubuntu clean失败,则必须从商店中卸载该应用程序,然后重新安装。参见WSL#2387


0

启动-> cmd / d

ubuntu config-默认用户root

启动-> C:\ Windows \ System32 \ bash

passwd your_username设置new_password并确认new_password关闭bash

回到cmd / d

ubuntu config-默认用户your_username

启动bash,并在需要时随意使用new_password作为your_username(例如“ sudo apt-get install gcc”)

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.