- 控制面板 - 程序和功能 - 启用或删除 Windows 功能 - 适用于 Linux 的 Windows 子系统
- win+u 开启设置界面,搜索 “开发者”,启用 “开发人员模式”
- win+x PowerShell(管理员),输入 dism /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux
- wslconfig /l 查看已安装的子系统
- wslconfig /u 发行版名 删除已安装的子系统
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
出现这种错误多半是在执行完上面错误一里解决方法中描述的重启电脑后,还没等几分钟就心急关闭电脑,这个时候UBUNTU没来得及安装然后就出现报错。
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
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
sudo apt-get install zsh
zsh --version
在.bash_profile中启用zsh,编辑文件,在末尾添加:
exec zsh
source .zshrc