[精简linux] 快速在window搭建linux验证平台
原创
©著作权归作者所有:来自51CTO博客作者xuejianqiang的原创作品,请联系作者获取转载授权,否则将追究法律责任
基于windos应用商店的ubuntu系统,解压即用,方便快捷,
下载地址:javascript:void(0)
一、 任意目录解压后,如图
然后打开windos子系统:(必须)
1.控制面板–>程序–>启用或关闭Windows功能–>勾选适用于Windows的Linux子系统
2.勾选“应用于Linux的Windows子系统”点击确定之后,需要重启电脑
二、 双击运行“ubuntu.exe”
- 初次运行,会解压文件,稍等几分钟。
- 安装完毕后,会提示创建用户号和密码
- 创建完毕后,如图
三、 自动将windos硬盘映射。(演示位置)
映射位置如图,在mnt位置挂载了C盘和D盘四、 修改镜像源,方便下载工具
终端命令: sudo vim /etc/apt/sources.list
- 替换以下内容
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
## Pre-released source, not recommended.
# deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
- 执行更新命令
sudo apt update
sudo apt upgrade
【卸载Linux】
# 查看注册了哪些
wslconfig /l
# 注销 wls 服务
wslconfig /u Ubuntu
【重装Linux】
完成上文的卸载后,直接运行ubuntu.exe,就完成重装。