基于windos应用商店的ubuntu系统,解压即用,方便快捷,
下载地址:https://download.csdn.net/download/qq_29246181/85211796
一、 任意目录解压后,如图
然后打开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,就完成重装。
图形化界面
GCC
sudo apt-get install -d build-essential
sudo apt-get install build-essential module-assistant
sudo apt-get install gcc-multilib g+±multilib
32位 运行环境
sudo apt install qemu-user-static
sudo update-binfmts --install i386 /usr/bin/qemu-i386-static --magic ‘\x7fELF\x01\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00’ --mask ‘\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xf8\xff\xff\xff\xff\xff\xff\xff’
sudo service binfmt-support start
开机自动运行:
打包带走
wsl --list --verbose
进行导出安装包。注意,你当前操作目录就是你导出的tar文件后的文件所在位置
wsl --export Ubuntu-20.04 ubuntu.tar
导出后,将安装包复制到另一台计算机中,然后使用下面的命令:
wsl --import Ubuntu20-04 D:\ubuntu_wsl