旧版 WSL 的手动安装步骤 | Microsoft Docs
安装 | Dev on Windows with WSL (spencerwoo.com)
Win10使用WSL2正确姿势 - 知乎 (zhihu.com)
这个参考差不多这个流程
https://www.cnblogs.com/zmblx/p/15014807.html
环境安装:
https://blog.csdn.net/m0_46702738/article/details/106059563
1.确保系统版本是否符合
只有 Windows 10 版本 18362 或 18363 以及以后的版本,或小版本号为 1049 的版本,才能够正常运行 WSL 2
开启「适用于 Linux 的 Windows 子系统」的附加功能
无论使用 WSL 1 还是 WSL 2,我们都需要开启「适用于 Linux 的 Windows 子系统」的附加功能:
以管理员身份打开 PowerShell 终端
运行下面的命令:
$ Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
3.直接应用商店安装ubuntu20.04
4.下载wsl2 更新包
参考旧版 WSL 的手动安装步骤 | Microsoft Docs
5.wsl --set-version Ubuntu-20.04 2 设置版本
6.安装环境:
配置阿里云镜像:
sudo vim /etc/apt/sources.list
# deb http://mirrors.aliyun.com/ubuntu/ xenial main
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
# deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
# deb http://mirrors.aliyun.com/ubuntu/ xenial universe
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
# deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
# deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
# deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
# deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
#
deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main universe
#20.04
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
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
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
sudo apt-get install -y libgl1-mesa-dev g++-multilib
sudo apt-get install -y git flex bison gperf build-essential
sudo apt-get install -y tofrodos python-markdown libxml2-utils xsltproc
sudo apt-get install -y dpkg-dev libsdl1.2-dev
sudo apt-get install -y git-core gnupg flex bison gperf build-essential
sudo apt-get install -y zip curl zlib1g-dev gcc-multilib g++-multilib
sudo aptitude install lib32ncurses5-dev
sudo apt-get install -y x11proto-core-dev libx11-dev
sudo apt-get install -y libgl1-mesa-dev libxml2-utils xsltproc unzip m4
sudo apt-get install -y lib32z-dev ccache
sudo apt-get install -y libssl-dev
sudo apt-get install -y libesd0-dev
i386安装不上 需要这么操作
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y libc6-dev-i386
sudo apt-get install -y libncurses5-dev:i386
sudo apt-get install -y zlib1g-dev:i386
sudo apt-get install -y libx11-dev:i386
sudo apt-get install -y libreadline6-dev:i386
7.离线安装openjdk7
下载离线包 包目录执行
(79条消息) 在Ubuntu 18.04.1系统中安装Jdk 7(openjdk-7-jdk)_cwh的博客-CSDN博客_openjdk-7-jdk
sudo dpkg -i *.deb
sudo apt install -f
8.安装软件
Windows Terminal
sudo ln -s /usr/bin/python2.7 /usr/bin/python
9.build
make -j32 2>&1 | tee build.log
10.后记
编译成功了 ,但是非wsl子系统 目录代码 进行编译会出现
*** Case-insensitive filesystems not supported. Stop.
解决方法
LxRunOffline
moving Linux filesystem · Issue #449 · microsoft/WSL · GitHub