Windows 11 安装WSL

Title Windows 11 安装WSL
Framework Windows 11
User wy8817399@vip.qq.com
Id 59
Created 2/27/26, 4:50 PM
Modified 3/2/26, 3:02 PM
Published Yes
Content

1、管理员权限打开PowerShell

2、安装 Windows 子系统 for Linux (WSL) 功能,但不自动安装任何具体的 Linux 发行版。

wsl --install --no-distribution

 

3、查看在线可安装系统(有时候网络不好会报错)

wsl --list --online

 

4、安装其中某一个系统,根据提示输入用户名和密码

wsl --install -d Ubuntu-24.04


5、Ubuntu24.04镜像

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo vim /etc/apt/sources.list
deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

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-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse