Wsl_ubuntu18_04_6 windows11(WSL)安装Linux18.04.6LTS 先将WSL2设为默认版本 1 wsl --set-default-version 2 然后在windows应用商店搜索ubuntu找到ubuntu18.04.6下载安装 ubuntu换源脚本 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #!/bin/bash cp /etc/apt/sources.list /etc/apt/sources.list.bak cat /etc/apt/sources.list > /etc/apt/sources.list cat > /etc/apt/sources.list << endl ## 18.04LTS # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse # 预发布软件源,不建议启用 # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse endl 1 sudo apt update -y && sudo apt upgrade -y 卸载wsl-ubuntu18.04.6参考链接: Windows子系统(WSL2)中自定义安装Ubuntu并换源 Windows 10(WSL) 安装Linux发行版Ubuntu18.04