- 设置” 启用或者关闭Windows功能“,勾选如下选项。
Hyper-v若存在灰色,可进入BIOS-Configuration,Intel Virtual Technology设置Enable
重启
2、安装Ubuntu
3、移动。Ubuntu默认安装C盘。
首先D盘创建移动的目录,例如:D:\Ubuntu
Windows 终端执行导出命令
wsl --export Ubuntu D:\Ubuntu\ubuntu.tar
注销原来的Ubuntu
wsl --unregister Ubuntu
从 D:\Ubuntu 导入
wsl--import Ubuntu D:\Ubuntu\ubuntu.tar
4、打开终端,以 Windows Terminal
选择Ubuntu,等待installing...
输入用户名、密码、root密码等
5、更换镜像源,修改 /etc/apt/sources.list
备份原文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
修改文件内容,使用vim,Esc切换命令行,i进入编辑
sudo vi /etc/apt/sources.list
阿里源镜像
deb https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
## Not recommended
# deb https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
ZZ:保存退出
更新源
sudo apt update
sudo apt-get upgrade
6、安装常用工具
sudo install make openssl wget vim