Win10下用自帶Linux系統搭建開發環境
Win10下用自帶Linux系統搭建開發環境
啟用Linux
老版本(win10 1709之前):
新版本(win10 1709之后)
卸載linux
老版本
新版本
安裝環境
安裝最新版nodejs(庫依賴會直接安裝python2)
安裝pip3
更新apt-get源 (網速快的話不建議更新,各種版本錯亂的問題比較煩心)
啟用Linux
老版本(win10 1709之前):
新版本(win10 1709之后)
卸載linux
老版本
新版本
安裝環境
安裝最新版nodejs(庫依賴會直接安裝python2)
安裝pip3
更新apt-get源 (網速快的話不建議更新,各種版本錯亂的問題比較煩心)
啟用Linux
老版本(win10 1709之前):
新版本(win10 1709之后)
- 設置——啟用針對開發人員模式——啟用開發人員模式
- 啟用或關閉windows功能——啟用適用於Linux的windows子系統
- 應用商店——搜索linux(前兩步不要省略,否則會報錯)

- 選擇版本——安裝
- 命令行wsl或bash或點擊新裝的Ubuntu打開linux環境(暫無沒找到辦法默認啟用zsh)

- cmd-wslconfig命令管理linux版本

卸載linux
老版本
- CMD命令卸載
lxrun /uninstall /fulllxrun /uninstall /full
新版本
安裝環境
安裝最新版nodejs(庫依賴會直接安裝python2)
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -setup_5.x
Ubuntu默認安裝了python3.5 路徑在/usr/bin下,將python3修改為默認python (上一步安裝了python2,所以python默認為python2)
ubuntu@user~:ln -s /usr/bin/python3.5 /user/bin/python
安裝pip3
# 安裝pip3 命令默認為pip3
sudo apt-get install python3-pip
# 或者
# 安裝pip2 命令默認為pip
sudo apt-get install python-pip
更新apt-get源 (網速快的話不建議更新,各種版本錯亂的問題比較煩心)
# 1.備份原來的數據源配置文件
cp /etc/apt/sources.list /etc/apt/sources.list_backup
# 2.編輯數據源配置文件
vim /etc/apt/sources.list
# 在這里我使用的是阿里雲的數據源:
#============================================================================
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
#============================================================================
# 3.更新配置
apt-get updat





