Install
切换到Developer Mode
Win+I
打开 Setting
,打开Developer Mode
。
安装Windows Subsystem for Linux(Beta)
依次打开Control Panel
- Programs
- Turn Windows features on or off
,Windows Subsystem for Linux(Beta)
打钩。
安装完成后重启。
安装Ubuntu on Windows
打开控制台,输入bash
,输入y
安装完成后:
bash使用
进入bash后,就相当于进入Linux子系统啦,后面的操作和平时使用的 Ubuntu 是一样的。
查看当前发行版
cat /etc/issue
升级软件仓库
换源
- 备份
sources.list
:
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
- 修改为阿里云的源(修改
sources.list
):
sudo cat /etc/apt/sources.list
- 修改
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
(也可以修改为163的源,see http://mirrors.163.com/.help/ubuntu.html)
更新列表
sudo apt-get update
下载并安装更新
sudo apt-get upgrade
使用Oh My Zsh
安装zsh
:
sudo apt-get install zsh
安装Git
:
sudo apt-get install git
安装Oh My Zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
在bash
中使用zsh
在Cmder中使用zsh
打开cmder
,输入Win+Alt+P
打开Settings
,在Startup
中找到Command line
:
打开Cmder
后,希望:
- 直接进入
cmd
:不填 - 直接进入
bash
:填%windir%\system32\bash.exe ~ -cur_console:p
- 直接进入
zsh bash
:填%windir%\system32\bash.exe ~ -c zsh -cur_console:p
从bash进入电脑CDE盘
cd /mnt
后,mnt目录下就相当于我的电脑
了
Reference
- MSDN - Installation Guide
- https://www.zhihu.com/question/42228124
- https://www.howtogeek.com/258518/how-to-use-zsh-or-another-shell-in-windows-10/
- https://www.maketecheasier.com/install-zsh-and-oh-my-zsh-windows10/
- https://gingter.org/2016/11/16/running-windows-10-ubuntu-bash-in-cmder/
- https://gingter.org/2016/08/17/install-and-run-zsh-on-windows/