Original article, originally published by SZHSHP’s Third Institute for Border Studies, reprint please specify

The installation

Execute in PowerShell

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

Copy the code

Restart the computer

configuration

Apt – get in the source

Rename the original file for backup

sudo mv /etc/apt/sources.list /etc/apt/source.list.bak
Copy the code

Edit the source list file

sudo vim /etc/apt/sources.list
Copy the code

Use the following

(note that this is only for Ubuntu16.04, which should be the default when you install.)

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted  universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse## Beta source
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# source
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
## Beta source
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# Canonical Partner and attach
deb http://archive.canonical.com/ubuntu/ xenial partner
deb http://extras.ubuntu.com/ubuntu/ xenial main
Copy the code

Then the bash aspect is updated:

sudo apt-get update
sudo apt-get upgrade
Copy the code

zsh

ZSH installation is a cliche

Simple installation read this article directly

Of course, oH-my-ZSH should also be installed together

ZSH cannot be the default shell

This part of the system is different from pure Ubuntu

After installing ZSH, first take a look at your current shell

echo $SHELL 
Copy the code

It should show

/bin/bash
Copy the code

After all, using various methods to switch failed, according to the relevant Issue, at this time should edit the file:

vi ~/.bashrc
Copy the code

Add to the end of the file

bash -c zsh
Copy the code

This will automatically enter ZSH

autojump_chpwd:4:nice(5) failed: operation not permitted

This is a very strange problem. According to the relevant Issue, ZSH wants to adjust the priority of the process, so the error is caused

You need to add a sentence at the end of the.bashrc file

unsetopt BG_NICE
Copy the code

Then restart bash to fix the problem

It’s not that easy to configure

reference

  • https://docs.microsoft.com/en-us/windows/wsl/install-win10
  • https://www.cnblogs.com/gabin/p/6519352.html
  • https://www.cnblogs.com/seayxu/p/5568830.html
  • https://github.com/Microsoft/WSL/issues/1887