【问题标题】:How To Install WSL without Windows Store?如何在没有 Windows 应用商店的情况下安装 WSL?
【发布时间】:2019-11-25 11:02:13
【问题描述】:

我有 windows 10 企业版,我发现这个版本没有 windows 商店 如何使用 ubuntu 安装 linux 子系统(WSL)?

【问题讨论】:

  • 你的问题到底是什么?

标签: windows-10 windows-subsystem-for-linux


【解决方案1】:

找到了使用 powershell 的解决方案!

参考文献

Powershell 作为管理员

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

cd c:\

Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile Ubuntu.appx -UseBasicParsing

Rename-Item ./Ubuntu.appx ./Ubuntu.zip
Expand-Archive ./Ubuntu.zip ./Ubuntu

cd ./Ubuntu

.\ubuntu1604.exe

$userenv = [System.Environment]::GetEnvironmentVariable("Path", "User")
[System.Environment]::SetEnvironmentVariable("PATH", $userenv + ";C:\Ubuntu", "User")

【讨论】:

  • 谢谢 - 这对那些因任何原因无法访问微软商店的人非常有帮助..
  • 确实很有帮助!
  • 如果我想使用 Debian,而不是 Ubuntu,我在哪里可以找到 'wsl-ubuntu-1604' 的替代品?
【解决方案2】:

Bar Nuri 的 PowerShell 命令非常完美,但在我的工作主机上由于某些(公司?)原因,由于某些权限问题,它不能“按原样”工作

Powershell 作为管理员

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Powershell 使用我的非管理员用户

cd .\debian 
.\debian.exe
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: me
New password:
Retype new password:
passwd: password updated successfully
Installation successful!

$userenv = [System.Environment]::GetEnvironmentVariable("Path", "User")
[System.Environment]::SetEnvironmentVariable("PATH", $userenv + ";C:\Users\me\debian", "User")

否则,当尝试以管理员身份运行 debian.exe 时,我只是得到很多“权限被拒绝”并且安装被锁定

不知道,但它可以正常工作 --> 谢谢!

(它允许在用户选择的合适位置提取 WSL 容器)

【讨论】:

    【解决方案3】:

    我知道这是一篇旧帖子。但我找到了另一种方法。

    您可以在 PowerShell 或命令提示符下以管理员身份运行它:

    wsl --install
    

    如果您想查看其他发行版:

    wsl --list --online
    

    为了安装它,你可以运行(例如在 WSL 上安装 Debian):

    wsl --install -d Debian
    

    更多信息可以阅读this post

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-19
      • 1970-01-01
      • 2015-12-09
      • 1970-01-01
      • 2014-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多