Ubuntu 16.04 下安装 zsh 和 oh-my-zsh

Ubuntu 16.04 下安装 zsh 和 oh-my-zsh

一个能使你命令行变得漂亮的工具!

提示:Mac系统下是默认安装了zsh,linux没有安装,所以需要自行安装

1.安装zsh

1
2
apt update
apt install zsh -y

2.改变默认shell为zsh

1
chsh -s /bin/zsh

3.解决chsh: PAM: Authentication failure,直接修改用户配置,把bash改成zsh

1
2
3
4
5
sudo vim /etc/passwd

root:x:0:0:root:/root:/usr/bin/bash

![](https://leanote.com/api/file/getImage?fileId=5adc5f05ab644172bd00105b)

4.安装Git

1
apt install git -y

5.安装oh-my-zsh

官网
安装oh-my-zsh是更好的去安装插件,以便提高效率

1
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

安装完成,插件的安装请看我的另一篇文章

macOS-High-Sierra-10-13-3全新搭建PHP开发环境

6.卸载oh-my-zsh

如果你想卸载oh-my-zsh, 只需要执行uninstall_oh_my_zsh zsh, 从命令行运行. 这将删除本身和恢复你以前的bash或者zsh配置

1
2
3
uninstall_oh_my_zsh zsh
或者
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/uninstall.sh)"
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×