zoukankan      html  css  js  c++  java
  • Windows10 ubuntu子系统的启用即基础配置

    Windows 10 在一周年更新后,本身集成一个不带有图形界面的ubuntu 14.04系统了,大大方便了Linux开发,并且本身使用很方便,像我这种Windows死忠,只会在Linux下跑一下一定用Linux才能跑的东西的人,很喜欢这个子系统。不过由于相关的使用资料缺乏以及没有图形界面,可能还是不能完全取代虚拟机。

    开启方法如下:

    1. 设置-更新和安全-针对开发人员,在“使用开发人员功能”中勾选开发人员模式。

    2. 控制面板里搜素“程序和功能”,点击“启用和关闭Windows功能”,拉到最下,勾选适用于Linux的Windows子系统(Beta)。

    3. 以管理员模式打开cmd并输入bash回车,输入y下载安装ubuntu,如果你没代理那下载会很恶心,不过有个代理其实很快的。此后有几个提示,包括解压,切语言,都输入y就好,不过这个过程挺慢的,不太清楚原因,往往比下载还慢。

    4. 下载后提示创建用户,输入密码,按提示即可,此后,你拥有了一个ubuntu子系统,并且启用极为方便,支持apt。

    为了方便,你可以在注册表里把这个子系统直接添加到右键菜单,就像是用Git一样。

    通过这种方法,在子系统里安装git就可以轻松使用了,不再需要在Windows下安装那个继承了Linux环境的Git。

    5. 此后你可以在cmd下通过lxrun/uninstall去卸载,或用其他命令去管理该子系统。

    6. 进入子系统后,第一件事当然是换源,教育网下建议换清华源:

    # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

    # 预发布软件源,不建议启用
    # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse

    7. 更新列表,更新软件,开始使用吧~

  • 相关阅读:
    POJ 1141 括号匹配 DP
    881. Boats to Save People
    870. Advantage Shuffle
    874. Walking Robot Simulation
    文件操作
    861. Score After Flipping Matrix
    860. Lemonade Change
    842. Split Array into Fibonacci Sequence
    765. Couples Holding Hands
    763. Partition Labels
  • 原文地址:https://www.cnblogs.com/cielosun/p/6635243.html
Copyright © 2011-2022 走看看