Press "Enter" to skip to content

WSL下载、安装与设置(Windows Subsystem for Linux)

WSL下载、安装与设置(Windows Subsystem for Linux) – 哔哩哔哩 (bilibili.com)

www.bilibili.com/read/cv15545635

1、打开控制面板–>打开程序–>选择启用或关闭Windows功能

2、下翻至底部,选择适用于Linux的Windows子系统,点击确定

3、选择立即重启电脑

4、电脑重启后,在Microsoft Store下载Ubuntu,等待安装完成

5、在开始菜单中找到Ubuntu,打开

6、首次打开报错处理

打开终端,输入wsl –set-default-version 1

7、重新打开Ubuntu

8、等待安装完成,输入用户名和密码(用户名全小写),WSL安装完成

9、更改Ubuntu源:

①在Ubuntu中输入如下内容:

   sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

   lsb_release -c

   sudo vim /etc/apt/sources.list

②输入ggdG删除sources.list中的所有内容

③输入i进入编辑模式

④将以下内容黏贴到sources.list中(将默认的下载源替换为阿里源)

默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释

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

⑤按Esc,输入:wq,保存并退出

⑥在Ubuntu中输入以下内容进行更新

sudo apt-get update

sudo apt-get upgrade

10、WSL的安装和设置初步完成 作者:Vaciller https://www.bilibili.com/read/cv15545635 出处:bilibili

发表评论