Skip to content

Instantly share code, notes, and snippets.

@szy0syz
Last active February 7, 2020 02:50
Show Gist options
  • Save szy0syz/57540359f5e8917196a770864c2cdfdf to your computer and use it in GitHub Desktop.
Save szy0syz/57540359f5e8917196a770864c2cdfdf to your computer and use it in GitHub Desktop.
Windows 安装 Ubuntu 18.04 子系统 和 zsh + cmder

安装

  • 控制面板 - 程序和功能 - 启用或删除 Windows 功能 - 适用于 Linux 的 Windows 子系统
  • win+u 开启设置界面,搜索 “开发者”,启用 “开发人员模式”
  • win+x PowerShell(管理员),输入 dism /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux
  • wslconfig /l 查看已安装的子系统
  • wslconfig /u 发行版名 删除已安装的子系统

错误一:Error Code: 0x8007019e

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

错误二:Error Code: 0x8000000D

出现这种错误多半是在执行完上面错误一里解决方法中描述的重启电脑后,还没等几分钟就心急关闭电脑,这个时候UBUNTU没来得及安装然后就出现报错。

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

替换Ubuntu apt 阿里云源

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

#阿里云源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

安装 oh-my-zsh

sudo apt-get install zsh
zsh --version

在.bash_profile中启用zsh,编辑文件,在末尾添加:

exec zsh
source .zshrc

WSL+cmder+oh-my-zsh美化win10命令工具(terminal)

(https://juejin.im/post/5cd521a2f265da03a33c522e)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment