启用 wsl
确定系统为 windows 10 2004 以后的版本
右击“菜单”-“设置”-“应用”-“程序和功能”-“启用或关闭windows功能”
框选“适用于linux的windows子系统”
重启系统应用设置
安装 wsl2 ubuntu 20.04
启用 wsl2
?
1
2
3 |
dism.exe /online /enable-feature /featurename:microsoft-windows-subsystem-linux /all /norestart
dism.exe /online /enable-feature /featurename:virtualmachineplatform /all /norestart
wsl --set-default-version 2 |
打开“microsoft store”,搜索 ubuntu20.04,并点击安装
下载完成之后,从开始菜单启动 ubuntu 20.04 lts
更新软件源并更新
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 |
sudo tee /etc/apt/sources .list << eof
deb http: //mirrors .163.com /ubuntu/ $(lsb_release -cs) main restricted universe multiverse
deb http: //mirrors .163.com /ubuntu/ $(lsb_release -cs)-security main restricted universe multiverse
deb http: //mirrors .163.com /ubuntu/ $(lsb_release -cs)-updates main restricted universe multiverse
deb http: //mirrors .163.com /ubuntu/ $(lsb_release -cs)-proposed main restricted universe multiverse
deb http: //mirrors .163.com /ubuntu/ $(lsb_release -cs)-backports main restricted universe multiverse
deb-src http: //mirrors .163.com /ubuntu/ $(lsb_release -cs) main restricted universe multiverse
deb-src http: //mirrors .163.com /ubuntu/ $(lsb_release -cs)-security main restricted universe multiverse
deb-src http: //mirrors .163.com /ubuntu/ $(lsb_release -cs)-updates main restricted universe multiverse
deb-src http: //mirrors .163.com /ubuntu/ bionic-proposed $(lsb_release -cs) restricted universe multiverse
deb-src http: //mirrors .163.com /ubuntu/ bionic-backports $(lsb_release -cs) restricted universe multiverse
eof
sudo apt-get update
sudo apt-get upgrade -y |
安装 docker
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 |
sudo apt-get install -y apt-transport-https \\
ca-certificates \\
curl \\
gnupg-agent \\
software-properties-common
curl -fssl https: //mirrors .tuna.tsinghua.edu.cn /docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \\
"deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu bionic stable"
# 目前 20.04 还没有国内清华 docker 源,暂时用 18.04 版本
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo cp /mnt/c/windows/fonts /usr/share/fonts/chinese -r
cd /usr/share/fonts/chinese
sudo mkfontscale
sudo mkfontdir
fc-cache -fv
source /etc/profile
sudo chmod -r 755 * |
安装 zsh
?
1
2 |
sudo apt-get install zsh
sh -c "$(wget -o- https://gitee.com/kingscat/ohmyzsh/raw/master/tools/install.sh)" |
到此这篇关于windows10安装wsl2 ubuntu20.04并设置docker环境的方法的文章就介绍到这了,更多相关windows10安装wsl2 ubuntu20内容请搜索快网idc以前的文章或继续浏览下面的相关文章希望大家以后多多支持快网idc!
原文链接:https://blog.csdn.net/kingsleyluoxin/article/details/105725042
相关文章
猜你喜欢
- 服务器租用价格怎么计算?服务器租用多少钱一年? 2025-05-27
- 云服务器的“弹性”体现在哪些方面? 2025-05-27
- 刀片服务器是什么 刀片服务器的主要特点 2025-05-27
- 利用FTP和计划任务自动备份网站数据和数据库 2025-05-27
- 服务器技术之硬件冗余技术 2025-05-27
TA的动态
- 2025-07-10 怎样使用阿里云的安全工具进行服务器漏洞扫描和修复?
- 2025-07-10 怎样使用命令行工具优化Linux云服务器的Ping性能?
- 2025-07-10 怎样使用Xshell连接华为云服务器,实现高效远程管理?
- 2025-07-10 怎样利用云服务器D盘搭建稳定、高效的网站托管环境?
- 2025-07-10 怎样使用阿里云的安全组功能来增强服务器防火墙的安全性?
快网idc优惠网
QQ交流群
您的支持,是我们最大的动力!
热门文章
-
2025-05-27 83
-
2025-05-26 83
-
2025-05-27 21
-
2025-05-27 95
-
2025-05-27 71
热门评论