升级 Windown 10 内置 Ubuntu 子系统

17-07-15 08:30 21178 0 技术

查看当前版本

打开命令提示符,输入 bash,然后输入

lsb_release -a

更换阿里云源

vim /etc/apt/sources.list

内容替换为

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
$ aptitude update
$ aptitude safe-upgrade -y
# 注1:升级过程中会提示你重启服务(restart services),选yes
# 注2:还会出现文件冲突,保留当前版本(current version)即可,输入N

把所有包升级至 16.04 (xenial) 的最新版,并重装丢失的aptitude包,最后清理无用包

$ apt-get dist-upgrade
$ apt-get install aptitude
$ apt-get autoremove

lxrun 使用方法

对 LX 子系统执行管理操作

用法:
    /install - 安装子系统
        可选参数:
            /y - 不提示用户接受
    /uninstall - 卸载子系统
        可选参数:
            /full - 执行完全卸载
            /y - 不提示用户接受
    /setdefaultuser - 配置将用于启动 bash 的子系统用户。如果该用户不存在,则会创建该用户。
        可选参数:
            username - 提供用户名
            /y - 如果提供了用户名,则不提示创建密码
    /update - 更新子系统的包索引

卸载旧版本

打开命令提示符

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

安装新版本

打开命令提示符

C:\WINDOWS\system32>lxrun /install
-- Beta 版功能 --
这将在 Windows 上安装由 Canonical 分发的 Ubuntu,
根据其条款的授权参见此链接:
https://aka.ms/uowterms

键入“y”继续: y
正在从 Windows 应用商店下载... 100%
正在提取文件系统,这将需要几分钟的时间...
请创建默认的 UNIX 用户帐户。该用户名不需要与 Windows 用户名匹配。
有关详细信息,请访问: https://aka.ms/wslusers
请输入新的 UNIX 用户名:
root
找到 UNIX 用户: root
安装成功!

不卸载直接升级Ubuntu 14.04:

sudo do-release-upgrade

微软和Canonical官方均不推荐使用该方法,如果你要使用请参考:Ubuntu 16.04 安装指南。

请登录后发表评论 点击登录

文章归档

文章日历

2024 年 04 月
29 01 02 03 04 05 06
07 08 09 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
29 30 01 02 03 04 05

文章标签

最新评论

友情链接