更换yum镜像源

1
2
3
4
5
6
$ ls /etc/yum.repo.d
$ mv /etc/yum.repo.d/CentOS-Base.repo /etc/yum.repo.d/CentOS-Base.repo.bak
$ curl -o /etc/yum.repo.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
$ yum clean all
$ yum makecache
$ yum update

最小化安装没有ifconfig命令

1
$ yum install -y net-tools

安装zsh (版本为5.0.2, 不可使用p10k主题)

1
2
$ yum install -y zsh
$ chsh -s /bin/zsh

安装 git

1
$ yum install -y git

安装ohmyzsh

1
2
3
4
$ sh -c "$(curl -fsSL https://install.ohmyz.sh/)"
$ cd ~/.oh-my-zsh/custom/themes
$ git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git

修改主题:ZSH_THEME=”powerlevel10k/powerlevel10k”

zsh yum 安装版本为5.0.2 p10k要求zsh版本为 5.1.0+

卸载重装 zsh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 卸载 zsh 5.0.2
$ yum remove zsh -y
# 源码下载 zsh 5.9
$ curl -SsL https://nchc.dl.sourceforge.net/project/zsh/zsh/5.9/zsh-5.9.tar.xz?viasf=1 -o zsh-5.9.tar.xz
$ mkdir zsh-5.9
$ tar -xf zsh-5.9.tar.xz -C zsh-5.9
$ cd zsh-5.9
# 安装gcc
$ yum groupinstall "Development Tools" -y
# 源码编译前置依赖
$ yum install ncurses-devel
# 源码编译
$ ./configure
$ make -j4
$ make install
$ which zsh
$ echo "$(which zsh)" >> /etc/shells
$ chsh -s "$(which zsh)"

安装 zsh-syntax-highlighting 插件

1
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

修改插件:PLUGINS=(git zsh-syntax-highlighting)

__END__