Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove wsl and start again #2703

Closed
spences10 opened this issue Nov 28, 2017 · 23 comments
Closed

remove wsl and start again #2703

spences10 opened this issue Nov 28, 2017 · 23 comments
Labels

Comments

@spences10
Copy link

Is it possible to delete the whole WSL all files therein and start again?

I'd like to be able to start afresh, that means a clean install of Ubuntu and a clean file system, is that possible?

I've made a mess installing docker and docker.io and now don't seem to be able to uninstall docker.io

Related issue here: #2702

I'm wondering if it would be easier for me to start over again rather than spend the amount of time I have spent trying to find a solution that works.

Many thanks 👍

@spences10
Copy link
Author

Ok cool, and thanks 👍 it's a question, not a code issue, plus I thought I'd ask the people that would know, so it looks like:

lxrun /uninstall /full

Then I guess there no need to uninstall the Windows app afterwards?

@Biswa96
Copy link

Biswa96 commented Nov 28, 2017

@spences10 that's an old article. The new fall creators update add new executable file wslconfig.exe. Run command wslconfig.exe /u Ubuntu to remove Ubuntu (replace Ubuntu with other distro name). Then reinstall it in normal way if you want to do.

@zadjii-msft
Copy link
Member

In the Settings app, under Apps you should be able to find the Ubuntu app

image

Just hit uninstall there and reinstall it from the store, that should wipe all of the distro files so you can start clean.

@spences10
Copy link
Author

Thanks @Biswa96 and @zadjii-msft

Are these both valid options for the fall creators update?

@Biswa96
Copy link

Biswa96 commented Nov 28, 2017

Ya both valid for Fall CU. wslconfig is like general process and valid for any distro you install. But settings app shows the distro installed from Windows store only.

@spences10
Copy link
Author

Ok great, thanks, I'll close this issue now.

@LarsWH
Copy link

LarsWH commented Feb 20, 2018

I needed a fresh start and found this description usefull: https://www.howtogeek.com/261188/how-to-uninstall-or-reinstall-windows-10s-ubuntu-bash-shell/

  1. use a CMD prompt to run lxrun /uninstall
  2. Start the 'Windows Features' application and remove the check mark in "Windows Subsystem for Linux (Beta)"

@TelFiREgames
Copy link

TelFiREgames commented May 6, 2018

Can everyone just shut up with the "why didn't you google it?" You're literally cluttering up the entire Internet. I DID GOOGLE IT, THAT'S HOW I GOT HERE. By being obnoxious and unhelpful to this one person who didn't do their due diligence, you are also being rude and obnoxious and unhelpful to ALL THE PEOPLE WHO DID and got here afterwards.

@Jikodis
Copy link

Jikodis commented Sep 5, 2018

@LarsWH When running lxrun /uninstall I get Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution. I assume the other mentioned solutions in this thread are the prefered way now to uninstall WSL: wslconfig.exe /u Ubuntu etc. or the App section of Windows Settings app.

@LarsWH
Copy link

LarsWH commented Sep 5, 2018

@Jikodis I wouldn't know. But I would not have posted my reply 20 February if any of the 2017 answers had worked for me (so thanks for the thumbs down...)

@mascondante
Copy link

mascondante commented Oct 1, 2018

I try uninstalling via wslconfig and upon new install I get the same issue:

Enter new UNIX username: mascondante
groupadd: /etc/group.5: File exists
groupadd: cannot lock /etc/group; try again later.
adduser: `/usr/sbin/groupadd -g 1000 mascondante' returned error code 10. Exiting.

@mascondante
Copy link

Figured out my issue. My AV was blocking perl. https://imgur.com/h1HGZtf

@Neue-Ziel
Copy link

@LarsWH When running lxrun /uninstall I get Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution. I assume the other mentioned solutions in this thread are the prefered way now to uninstall WSL: wslconfig.exe /u Ubuntu etc. or the App section of Windows Settings app.

Thanks a lot, this solved my prob. I installed WSL under Windows Server 2019 which means not through Windows Store (because there is no store for server). After the installation, I moved the installation folder, and then I realized the folder also contains the path and the root folder of the subsystem, so I moved everything back, then I got errors all the time.

Google or bing gets the result of lxrun anywhere else which is deprecated in Server 2019. wslconfig.exe solve the uninstall issue and now I am okay to reinstall in the desired folder location. Thanks.

@probers1
Copy link

Just thought I would post my experience. I had to use wslconfgi.exe /l to see the list of distributions installed. my old Ubuntu install was labelled 'Legacy' instead of Ubuntu.

@djnorrisdev
Copy link

Came back to windows after not touching it for a year. Had sudo permission errors, so I ended up uninstalling Ubuntu through the Apps menu in settings and reinstalling through the store. Everything works now.

@b-hayes
Copy link

b-hayes commented Nov 18, 2019

I cant reinstall. Was half way through moving Ubuntu from wsl2 to wsl1 when it froze and then it couldn't be accessed at all. Uninstalled form the app settings and now I am unable to install it again.

@wormuth
Copy link

wormuth commented Nov 19, 2019

The "Apps and Features" -> "Uninstall" way didn't suffice for me: trying to reinstall it afterwards lead to 0x80073D05.
After manually deleting some - obviously remnant - <user>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows folder which seems to have survived the uninstall procedure the reinstallation finally worked.

@bengalih
Copy link

bengalih commented Nov 28, 2019

The "Apps and Features" -> "Uninstall" way didn't suffice for me: trying to reinstall it afterwards lead to 0x80073D05.
After manually deleting some - obviously remnant - <user>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows folder which seems to have survived the uninstall procedure the reinstallation finally worked.

Thanks so much. I found your post on this error code for a totally unrelated app that I couldn't get reinstalled. Sure enough, I found some entries under Packages which required some force-able removal, and I can now install the app!

@tenluap
Copy link

tenluap commented Oct 16, 2020

You could reset the app for the app setting.
Simply lets say you installed ubuntu wsl from the windows store
click on start and search for ubuntu
right click >> more >> app setting
reset the app
and that will give a clean version of the distro

@Pakistaniboy442
Copy link

Hello I Have Wanted To Do This But Sometimes Windows Just messes Up SO Just Disable And RE Enable WSL
P.S It Helped Me

@tlissak
Copy link

tlissak commented Dec 28, 2021

After trying everything steel shows files at \wsl$
so only this worked for me :

wslconfig.exe /u Ubuntu

@SehrishKhanSE2001
Copy link

I installed WSL half way but due to weak internet connection , i just closed my laptop and when i opened it again , i re ran wsl --install but the first thing it says is that it does not recognizes the command and then when i run wsl --install -d ubuntu , it says wslregistrationdistribution failed with error and wsl tool requires an update to it's kernel component too. Please provide some solution to this problem since my assignment is due and i dont know how to re start.
#9049
issue

@olsonperrensen
Copy link

The "Apps and Features" -> "Uninstall" way didn't suffice for me: trying to reinstall it afterwards lead to 0x80073D05. After manually deleting some - obviously remnant - <user>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows folder which seems to have survived the uninstall procedure the reinstallation finally worked.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests