WSL安装的示例分析
这篇文章主要介绍了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 --list --verbose
启动子系统:
通过安装的子系统终端打开;
通过命令打开,例如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/](http://mirrors.aliyun.com/ubuntu/) trusty main restricted universe multiverse deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-security main restricted universe multiverse deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-updates main restricted universe multiverse deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-proposed main restricted universe multiverse deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-backports main restricted universe multiverse deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty main restricted universe multiverse deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-security main restricted universe multiverse deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-updates main restricted universe multiverse deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-proposed main restricted universe multiverse deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-backports main restricted universe multiverse
文件保存后更新源,执行命令:sudo apt update && sudo apt upgrade
感谢你能够认真阅读完这篇文章,希望小编分享的“WSL安装的示例分析”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注行业资讯频道,更多相关知识等着你来学习!