delete Windows subsystem for Linux 并重新安装

 

Uninstalling a Linux distribution from the Windows Subsystem for Linux (WSL) can be done quickly using either the Windows Settings menu or the command line.

Keep in mind that following these steps will permanently delete all files, programs, and configurations stored within that specific Ubuntu instance. If you have important data inside the subsystem, be sure to back it up before proceeding.

Method 1: Using the Settings Menu (Simplest)

This is the most straightforward way to remove the Ubuntu application and its associated data.

  1. Open the Start Menu and click on the Settings (gear icon).

  2. Go to Apps > Apps & features.

  3. In the search box, type Ubuntu.

  4. Select Ubuntu 24.04 LTS from the list.

  5. Click Uninstall and confirm the action.


Method 2: Using the Command Line (Recommended for Clean Up)

If you want to ensure the registration is completely removed from the WSL management system, using PowerShell or the Command Prompt is highly effective.

  1. Open PowerShell or Command Prompt as an Administrator.

  2. Type the following command to see a list of your installed distributions and confirm the exact name:

    PowerShell
     
    wsl --list
    
  3. To unregister and delete the distribution, run:

PowerShell
 
    wsl --unregister Ubuntu-24.04

*(Note: If your distribution has a different name in the list, use that name instead.)*

 

This command specifically tells WSL to stop managing that instance and deletes the virtual hard disk file associated with it.

 

Verifying the Removal
After performing any of the methods above, you can verify that the subsystem is gone by running `wsl --list` again in PowerShell. If the uninstallation was successful, Ubuntu 24.04 will no longer appear in the output.

 

 

重新安装wsl

wsl --update

如果出现错误

可以去https://github.com/microsoft/WSL/releases

下载安装文件

安装完成后,下载

https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/26.04/ubuntu-26.04-wsl-amd64.wsl

然后在powershell中,

./ubuntu-26.04-wsl-amd64.wsl

会直接进行安装

 

后面都简单了

 

关于不显示汉字问题,参见这条:

Windows subsystem for Linux 汉字不显示

 

posted @ 2026-05-14 02:28  profesor  阅读(38)  评论(0)    收藏  举报