安装wsl

114 阅读1分钟

1 linux

  1. 启用或关闭Windows功能 - 适用于Linux的Windows子系统
  2. 微软应用商店搜索 Linux - Ubuntu 18.04 LTS
  3. 在 Windows 下查看 WSL 文件位置
C:\Users\用户名\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs

2 colorTool

  1. 下载地址 ColorTool
  2. 到解压目录下,执行挑选
colortool.exe -b deuteranopia
colortool.exe -b OneHalfDark
colortool.exe -b OneHalfLight
colortool.exe -b solarized_dark
colortool.exe -b solarized_light

3 修改源

  1. 复制
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
  1. 查看版本信息
lsb_release -c
  1. 增加源
sudo vim /etc/apt/sources.list
# 源地址
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
  1. 更新升级
sudo apt-get update
sudo apt-get upgrade

4 oh my zsh

  1. 安装 zsh
sudo apt-get install zsh
  1. 默认 shell 为 zsh,检查
chsh -s $(which zsh)
echo $SHELL
  1. 安装 oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# or
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

# 如果不能下载,可以用
sh -c "$(curl -fsSL https://gitee.com/shmhlsy/oh-my-zsh-install.sh/raw/master/install.sh)"
# or
sh -c "$(wget -O- https://gitee.com/shmhlsy/oh-my-zsh-install.sh/raw/master/install.sh)"
  1. 修改主题
sudo vim ~/.zshrc
ZSH_THEME="agnoster"
source ~/.zshrc

# 高亮,非必须
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
source ~/.zshrc