---
title: "如何升级Windows 10中内置的Ubuntu子系统"
url: https://www.landian.news/archives/34119.html
date: 2017-04-12T17:24:43+08:00
modified: 2017-04-12T09:24:43+00:00
author: "山外的鸭子哥"
description: "微软此前与Canonical达成合作并将Ubuntu带到Windows 10系统，用户在经过简单设置后即可使用 [&hellip;]"
categories: ""
tags: "Linux, Ubuntu, windows 10, WSL, 微软"
---

# 如何升级Windows 10中内置的Ubuntu子系统

微软此前与Canonical达成合作并将Ubuntu带到Windows 10系统，用户在经过简单设置后即可使用该系统。

该功能对于部分开发者而言应算是个不错的消息，这样可以直接使用[Windows 10](https://www.landian.news/archives/tag/Windows-10)完成某些[Linux](https://www.landian.news/archives/tag/Linux)的命令操作。

2015年7月微软发布 Windows 10 后默认获取的版本都是Ubuntu 14.04，不过目前这个版本已上升到16.04。

不过在升级上和其他 Ubuntu 机器相同也是比较麻烦的，直接使用在线升级的话可能会出现某些未知的问题。

因此微软官方和[Ubuntu](https://www.landian.news/archives/tag/Ubuntu)官方给出的推荐意见都是备份数据卸载Ubuntu 14.04后重新安装 Ubuntu 16.04 版。

**移除Ubuntu 14.04并升级：**

√移除前务必备份你的Ubuntu系统重要数据，移除动作将会清除已安装的任何应用程序和生成的用户即数据。

1、查看当前 Windows 10内置的Ubuntu系统版本，打开命令提示符输入 `bash` 回车然后键入如下命令回车：

```
root@landian: $lsb_release -a
```

2、打开命令提示符并使用WSL实用工具`lxrun`移除Ubuntu 14.04版（注意不是在Bash中），键入如下命令：

```
C:\WINDOWS\system32>lxrun /uninstall /full /y
这将在 Windows 中卸载 Ubuntu。
这将删除 Ubuntu 环境以及任何修改、新应用程序和用户数据。
正在卸载...
```

[!\[如何升级Windows 10中内置的Ubuntu子系统\](https://img.lancdn.com/landian/2017/04/34119-1.avif)](https://img.lancdn.com/landian/2017/04/34119-1.avif)

3、卸载完成后再使用lxrun重新安装Ubuntu子系统，这个时候默认获取到的就是Ubuntu 16.04 LTS版了：

```
C:\WINDOWS\system32>lxrun /install
-- Beta 版功能 --
这将在 Windows 上安装由 Canonical 分发的 Ubuntu，根据其条款的授权参见此链接:https://aka.ms/uowterms
键入“y”继续: y
正在从 Windows 应用商店下载... 77%
```

**不卸载直接升级Ubuntu 14.04：**

```
root@landian: $sudo do-release-upgrade
```

正如前文所述微软和Canonical官方均不推荐使用该方法，如果你要使用请参考：[Ubuntu 16.04 安装指南](https://help.ubuntu.com/lts/serverguide/installing-upgrading.html)。

[!\[如何升级Windows 10中内置的Ubuntu子系统\](https://img.lancdn.com/landian/2017/04/34119-2.avif)](https://img.lancdn.com/landian/2017/04/34119-2.avif)

**特别提醒：**

尽管安装界面提示正在从 [Windows](https://www.landian.news/archives/tag/Windows) 应用商店下载 Ubuntu，但实际上下载的地方并不是 [Windows Store](https://www.landian.news/archives/tag/Windows-store)。

根据蓝点网此前抓包分析的结果，Ubuntu子系统下载节点实际上位于澳大利亚某个已被屏蔽的CDN网络上。

因此国内下载安装Ubuntu子系统速度极为缓慢，例如在本文撰写时我们重新安装平均下载速度只有1Mbps。

所以下载速度慢只能慢慢等着下载，如果下载中途提示出错请参考这篇：[启用Linux子系统出错的解决方法。](https://www.landian.news/archives/26591.html)

---

Source: [如何升级Windows 10中内置的Ubuntu子系统](https://www.landian.news/archives/34119.html)
