WIN10安装WSL
Microsoft Store
安装编译套件
sudo apt-get install build-essential
apt换源
Debian / Ubuntu 的官方源在国内访问很慢,咱们更换为清华大学 TUNA 的软件源镜像
-
执行下面命令,备份 apt 安装源:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
-
vim编辑sources.list
sudo vim /etc/apt/sources.list
-
将 sources.list 中的内容替换如下:
- 注意:这里是
Ubuntu 18.04 LTS
- 如果是其他版本的ubuntu,自行访问[ 清华大学开源软件镜像站]去查找对应版本的镜像配置
- 注意:这里是
# 默认注释了源码镜像以提高 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.ed