今天为大家介绍如何才能启用Windows10下的Linux子系统,废话不多说,直接看步骤:
####启用开发者模式
打开设置
![](/d/20211016/a058bc9887dea4380e410ed7aa899010.gif)
点击更新和安全
![](/d/20211016/a5b6dbe908ba3f801ac4edaad0ac0310.gif)
点击开发者选项
![](/d/20211016/a45e6d942023e2c3488dd50db22ff11b.gif)
启用开发人员模式
![](/d/20211016/8b4a9917b3f63f850ade0178d50374f3.gif)
####更改系统功能
使用win+X快捷键调出系统管理菜单后点击应用和功能,然后拉到底下,选择程序和功能
![](/d/20211016/60c12a2f584a8aed798cd2016db35303.gif)
选中应用或关闭Windows功能
![](/d/20211016/95f31e9a03459bb1a6af24bd5d25f68f.gif)
勾选适用于Linux的Windows子系统,然后确认并重启就可以了
![](/d/20211016/14d8b2f6e5da0292de8191e0a74a9b0f.gif)
####安装Linux系统
打开功能以后系统中其实还没有安装Linux,需要使用cmd完成安装。
首先按Win+R开启cmd命令输入框,然后输入lxrun /install /y来下载Linux系统(注意斜杠后面前要空一格,要不然无法识别命令)
![](/d/20211016/35d795486e7d5eee045d0b394585bf43.gif)
好了,现在安装成功了,可以为所欲为了!
首先输入bash指令进入Ubuntu系统
![](/d/20211016/1e23de812260200971a6506f6a4ca1b3.gif)
接着可以输入passwd重置密码,重置完密码就可以正常使用Ubuntu系统了。至此,基本的安装工作就完成了。
=菜鸟分割线===
####Linux进阶
在Ubuntu下我们可以通过 apt-get 命令 很方便的安装 / 卸载软件,由于默认的软件包仓库是位于国外的,安装软件的时候就可能遇到各种网络问题或者下载到的一些资源不完整,因此就需要切换数据源为国内的镜像站点来改善。
编辑数据源配置文件 vi /etc/apt/sources.list
![](/d/20211016/68f71cb6844e6d4b0138946b42f29344.gif)
接着就进入vi编辑器
![](/d/20211016/01f83af21757cf4a7663b513c4de8332.gif)
继续按enter键进入真正的vi编辑页面
![](/d/20211016/9eac9ec31cdd0c85b54416b6f9ebd618.gif)
vi编辑器一共有三种模式,分别是命令模式(command mode)、插入模式(Insert mode)和底行模式(last line mode)。命令模式下我们只能控制屏幕光标的移动,字符、字或行的删除,移动复制某区段及进入Insert mode下,或者到 last line mode等;插入模式下可以做文字输入,按「ESC」键可回到命令行模式;底行模式下,可以将文件保存或退出vi,也可以设置编辑环境,如寻找字符串、列出行号等。
当我们进入vi编辑器的时候默认是命令行模式,这是后如果想编辑内容,就输入 i 命令就可以了。现在我们要把镜像源改为阿里的,所以插入如下内容:
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
接着按「ESC」退会命令行模式,输入命令行 wq! 保存退出就好了。
接着输入命令apt-get update更新配置就可以了,这个过程可能比较长,祝好运!
![](/d/20211016/3c90666fed6220fb581fb84527a03890.gif)
好了本教程到此结束,谢谢!
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。