windows安装Linux子系统Ubuntu并配置python3
- 其他
- 2025-08-18 20:51:03

环境说明:
Windows 11 Ubuntu 20.04.6
安装步骤以及问题:
1、开启Windows Subsystem for Linux
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart2、开启虚拟机特性
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart3、下载并安装WSL2更新包
link.zhihu /?target=https%3A//wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi4、将WSL2设置成默认
wsl --set-default-version 2注:以上命令均以powershell的管理员命令执行
若未执行以上命令,直接安装Linux子系统,会出现如下报错:
5、打开Microsoft store 获取(我已经安装,所以是打开,未安装则显示获取)
6、打开软件
配置用户名和密码,到此,安装结束
7、配置国内安装源(加快系统包安装速度)
备份配置文件:sudo cp /etc/apt/sources.list /etc/apt/sources_bk.list
修改配置文件:vim /etc/apt/sources.list
deb http://mirrors.aliyun /ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun /ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun /ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun /ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun /ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun /ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun /ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun /ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun /ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun /ubuntu/ bionic-backports main restricted universe multiverse将上述内容覆盖即可,
8、更新系统包列表
sudo apt update默认情况下,Ubuntu 20.04初始安装python3.8.10,但是未安装pip3
9、安装pip3
sudo apt install python3-pip此处,结束 20230920
windows安装Linux子系统Ubuntu并配置python3由讯客互联其他栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“windows安装Linux子系统Ubuntu并配置python3”