Comments (14)
There is an official way to uninstall. You'll want to use the "lxrun" command. Command to uninstall is:
lxrun /uninstall
That will keep your /root directory. If you would like to delete that as well try "lxrun /uninstall /full"
You can then type "bash" again to re-install.
Documentation can be found here: http://msdn.microsoft.com/en-us/commandline/wsl/reference
from wsl.
Finally was able to delete the files using this command:
C:\Users\Javier\AppData\Local>rmdir /S "\\?\C:\Users\Javier\AppData\Local\lxss"
Needed to use *\?* prefix in order to do anything on those files.
from wsl.
Question, did you try and delete directories as some people are trying?
Ok, here's what I normally do to get out of any install / uninstall errors. Note that this will delete everything on the instance including your home directory:
(everything at an admin cmd prompt)
- "lxrun /uninstall /full"
- "sc stop lxssmanager" wait a second for it to stop
- Manually delete your %localappdata%\lxss folder
That should clean everything off and let you start from scratch.
from wsl.
The uinstall worked great. Now getting an error on the install:
C:\Users>lxrun /install /y
-- Beta feature --
This will install Ubuntu on Windows, distributed by Canonical
and licensed under its terms available here:
https://aka.ms/uowterms
Downloading from the Windows Store... 100%
Error: 0x80070002
Any ideas?
from wsl.
For those interested, if you need to re-install bash to change the default user it can be done without a full uninstall and reinstall. lxrun
supports a couple of argument switches:
CMD> lxrun
Performs administrative operations on the LX subsystem
Usage:
/install - Installs the subsystem
Optional arguments:
/y - Do not prompt user to accept
/uninstall - Uninstalls the subsystem
Optional arguments:
/full - Perform a full uninstall
/y - Do not prompt user to accept
/setdefaultuser - Configures the subsystem user that bash will be launched as. If the user 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
/update - Updates the subsystem's package index
from wsl.
You probably did get a clean install, just with your files preserved. Your files are in %userprofile%\AppData\Local\lxss by default. You might try deleting the lxss folder after the uninstall. Then try reinstalling the feature. Disclaimer: I have no idea if this will work or cause really bad things to happen,
from wsl.
I initially tried only with lxrun /uninstall /full
It seems that I can't delete the lxss folder. The folder doesn't show up in %localappdata%, but you can navigate inside of it if you pass in the directory path in explorer (or cmd)
Inside, there seems to be two files that can't be deleted. If I try to delete any of the files or directories inside, windows says they don't exist.
from wsl.
Nothing I try in order to delete the ghost files/directories seems to be working.
from wsl.
After looking deeper into it, the two files that are left are named "Sourcing nvm.sh should make the nvm command available." which end in a period (and no extension), and I'm not sure if this might be causing the issue or not. I can't rename or delete the files.
Any ideas?
from wsl.
Closing this one since there is a work around here. @J-Gonzalez thanks for all your effort finding the correct commands.
from wsl.
Once I uninstall WSL using lxrun /uninstall
, I see that the data is still preserved in C:\Users\username\AppData\Local\lxss\home
.
I then install the new Ubuntu version from the Microsoft Store, and created a new user with the same username as before.
However, the content of the lxss/home
directory isn't copied/ synced to the new /home/username
directory. Would I need to copy it over manually?
Will the home directory of the new Ubuntu be stored in lxss/home
as well?
from wsl.
I'm late to the party, but after enabling the feature, you go to the store to install it
there is Ubuntu, openSUSE and SUSElinux available to me, but apparently fedora is an option too
from wsl.
How do I reinstall the one from the store? More specifically, how do I reinstall while keeping my data under home directory?
from wsl.
@likan999 It's easy to backup your home folder on Fall Creators Update. Just go to
%LocalAppData%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\home
and Cut&Paste the Ubuntu user folder to any folder on the same drive. (like for example c:\backups)
After that you can uninstall the Ubuntu app, reinstall it and finally move back the Ubuntu user folder. Just make sure on first run you create the same Ubuntu username as before.
from wsl.
Related Issues (20)
- WSL2-Linux-Kernel Headers HOT 3
- add vma sanity check in create_existing_sysmem (drivers/hv/dxgkrnl/dxgvmbus.c) HOT 8
- WSL2 is slow and makes my computer unresponsive when running a C++ build in Debug mode inside Docker container HOT 11
- Any wsl command is met with access denied after installing ubuntu 24 HOT 12
- Vmmem process suddenly and randomly takes close to 100% of CPU indefinitely HOT 3
- Why is it borderline impossible to downgrade WSL2? HOT 5
- Libvirt stop working after few minutes HOT 8
- Poor performance with WSL2 and Windows 11 HOT 9
- Can't boot Arch. Failed to translate Windows env variables and failed to mount disk partitions HOT 13
- After installing KB5036893, WSL now logs an event regarding "Invalid networking mode 'mirrored' in C:\Users\<username>\.wslconfig" HOT 6
- wsl.exe cpu too high HOT 8
- Error message on `wsl --exec` can be more informative HOT 3
- Cant change iptable HOT 2
- #WslRegisterDistribution failed with error: 0xc03a0014 Error: 0xc03a0014 A virtual disk support provider for the specified file was not found. HOT 1
- Web directory in wsl2 soft connects to win10 web directory, accessible but very laggy response【请求帮助!!!3Q】 HOT 4
- Unspecified error Error code: Wsl/Service/RegisterDistro/E_FAIL HOT 4
- disagree about version of symbol module_layout HOT 2
- WSL doesn't source ~/.bashrc when running wsl --shell-type login xeyes HOT 5
- ALSA error while running pygame from WSL2 - Windows 11 HOT 3
- graphical programs unresponsive after waking from suspend HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wsl.