win10 上安装 Debian Linux子系统

Win10 最近有了一个行的称号: 最强Linux发行版,为什么会有这么一个称号呢,因为win10的子Linux系统已经让win10集成了linux系统,应用商店里也已经上架了多种linux的发行版.

下边我们就以Debain系统为例,看一下如何在win10下集成子Linux系统.

应用商店下载子linux系统:

打开microsft store,搜索debian系统:

debian

同时还可以看到各种其他的发行版本:

linux

你可以选择自己喜欢的系统进行安装

在win10 上开启子Linux功能

在 控制面板-程序-添加新的windows功能 中勾选启用子linux系统

安装

打开装好的Debian应用就可以进行安装了,安装大概需要几分钟时间,安装完成后,即可使用了.

需要注意的事项

WSL没有独立的ip,既使用ifconfig命令会提示找不到命令.

我在安装django的过程中提示我没有mysqlclient,用pip安装又提示:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Collecting mysqlclient
Using cached mysqlclient-1.3.12.tar.gz
Complete output from command python setup.py egg_info:
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-dz3ro1x7/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "/tmp/pip-build-dz3ro1x7/mysqlclient/setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "/tmp/pip-build-dz3ro1x7/mysqlclient/setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-dz3ro1x7/mysqlclient/

google说需要安装 libmysqlclient-dev 但是 debian下找不到这个库.
用apt-cache 搜索到 应该安装的是 default-libmysqlclient-dev

安装成功后再次安装mysqlclient即可.

你的支持我的动力