Como o shell bash no Window pode ser completamente resetado?

2

Sou novo no Unix, mas estou interessado em aprender, então comecei a tentar usar o bash / Ubuntu no Windows. Infelizmente, o bash travou e agora o bash / Ubuntu parece estar quebrado, já que a maioria das pastas está faltando na pasta raiz do Ubuntu, por exemplo:

root@Desktop:~# ls
root@Desktop:~# cd /root
root@Desktop:~# ls
root@Desktop:~# ls -a
.  ..  .bashrc  .profile

Não tenho uma pasta %localappdata%\lxss (tenho certeza de que é aqui que a raiz do Linux era originalmente). Eu pareço ter uma pasta %localappdata%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc , que aparentemente é o novo local para a raiz do Linux, mas não está completa (ou seja, não contém uma pasta ...\LocalState\rootfs ).

Depois de procurar por soluções aqui e em outros lugares, tentei:

  • Desinstalando completamente o Ubuntu \ bash do Windows com lxrun.exe /uninstall full .
  • Como acima, em conjunto com a desativação e a reativação do recurso Windows Subsystem for Linux (beta) também.
  • Em execução: apt-get remove upstart , apt-get remove udev , apt-get autoremove em bash.

Infelizmente, nenhum dos itens acima resolveu o problema. Alguém pode sugerir uma maneira de realizar um "reset de fábrica" completo?

    
por Robert 03.01.2018 / 20:36

1 resposta

1

After searching for solutions on here and elsewhere, I've tried:

  • Completely uninstalling Ubuntu\bash from Windows with lxrun.exe /uninstall full.
  • As above, in conjunction with disabling and re-enabling the Windows Subsystem for Linux (beta) feature too.
  • Running: apt-get remove upstart, apt-get remove udev, apt-get autoremove in bash.

O lxrun.exe não deve funcionar na versão atual do WSL. Acho difícil acreditar que você tenha instalado o Windows Subsystem for Linux (Beta) , pois o recurso correto seria listado como Windows Subsystem for Linux no Windows 10 Versão 1709. Sua terceira solução não redefiniria nenhum ambiente WSL.

lxrun and bash.exe and associated tools are deprecated in the Fall Creators Update.

A única razão pela qual eu sei que você está executando o 1709 é devido à existência da pasta UbuntuonWindows_79rhkp1fndgsc .

I appear to have a %localappdata%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc folder, which is apparently the new location for the Linux root, but it is not complete (i.e. doesn't contain a ...\LocalState\rootfs folder).

Não é suposto conter essa pasta.

I don't have a %localappdata%\lxss folder (I'm pretty certain this is where the Linux root was original).

Esta é a localização da versão legada do WSL. Ele não está mais localizado lá e o método legado usado para redefinir o ambiente não funciona para a versão atual do WSL no Windows 10 Versão 1709 +

Eu disse especificamente que no meu responder .

The following answer only applies to WSL on Windows 10 1703 and 1607. WSL on Windows 10 1709+ can be installed from within the Windows Store UWP application.

Quanto à sua pergunta real ...

Unfortunately none of the above have solved the problem. Can anybody suggest a way to person a complete 'factory reset'?

Basta executar o comando:

wslconfig /unregister Ubuntu

Additionally, wslconfig /unregister, unregisters the distribution from WSL so it can be reinstalled or cleaned up.

Caution: Once unregistered, all data, settings, and software associated with that distribution will be permanently lost. Reinstalling from the store will install a clean copy of the distribution.

Depois de executar esse comando, você terá que reinstalar o Ubuntu através da Windows Store.

While Linux distributions can be installed through the Windows store, they can't be uninstalled through the store. WSL Config allows distributions to be unregistered/uninstalled.

Gerenciar várias distribuições do Linux no WSL

Referência de comandos

    
por 03.01.2018 / 22:33