1-WSL安装

官方文档: https://docs.microsoft.com/zh-cn/windows/wsl/

1.启用Windows10子系统功能

在控制面板-启用或关闭Windows功能中设置启用适用于Linux的Windows子系统,重启系统。
在这里插入图片描述
在这里插入图片描述

2.安装子系统

1.通过应用商店下载安装;
官方文档:https://docs.microsoft.com/zh-cn/windows/wsl/install-win10
2.通过手动下载进行安装
官方文档:https://docs.microsoft.com/zh-cn/windows/wsl/install-manual
安装通过Windows PowerShell执行命令:Add-AppPackage 包名

3.启动子系统

查看系统安装的子系统:wsl -l
启动子系统:

  1. 通过安装的子系统终端打开;
  2. 通过命令打开,例如ubuntu 20.04可以在Windows终端执行 ubuntu2004 进入子系统。

4.创建用户

启动子系统后,系统会要求创建用户。根据系统提示创建用户名,密码。
官方文档:https://docs.microsoft.com/zh-cn/windows/wsl/user-support

5.修改源

wsl 中执行: sudo vi /etc/apt/sources.list
在文件末尾添加:

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

文件保存后更新源,执行命令:sudo apt update && sudo apt upgrade

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值