zsh 在编译时依赖了 ncurses,如果机器上没有该依赖,需要编译安装。
下载 ncurses 源码:
wget http://ftp.gnu.org/gnu/ncurses/ncurses-6.2.tar.gz tar zxvf ncurses-6.2.tar.gz cd ncurses-6.2
设置环境变量:
export CXXFLAGS=" -fPIC"
export CFLAGS=" -fPIC"
编译安装 ncurses:
./configure --prefix=$HOME/.ncurses --enable-shared make make install
ncurses 就已经安装在了主目录下的.ncurses 下。
下载 zsh 源码:
wget http://sourceforge.net/projects/zsh/files/zsh/5.0.7/zsh-5.0.7.tar.gz/download
设置环境变量:
xport INSTALLATION_PATH='$HOME/.ncurses' export PATH=$INSTALLATION_PATH/bin/:$PATH export LD_LIBRARY_PATH=$INSTALLATION_PATH/lib:$LD_LIBRARY_PATH export CFLAGS=-I$INSTALLATION_PATH/include export CPPFLAGS="-I$INSTALLATION_PATH/include" LDFLAGS="-L$INSTALLATION_PATH/lib"
编译安装 zsh:
./configure --prefix=$HOME/.zsh --enable-shared make make install
zsh 将会被安装在主目录下的 .zsh 下。
在 .bashrc 中添加以下代码
exec $HOME/.zsh/bin/zsh
刷新.bashrc
source $HOME/.bashrc
zsh 设置完成,enjoy yourself~
curl 和 wget 任选其一
curl 安装
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
wget 安装
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
除非注明,否则均为山海經原创文章,转载必须以链接形式标明本文链接
本文链接:https://www.ifee.win/blog/2021/05/10/%e6%9c%ba%e5%99%a8%e6%97%a0root%e8%b6%85%e7%ba%a7%e7%94%a8%e6%88%b7%e6%9d%83%e9%99%90%e6%ba%90%e7%a0%81%e5%ae%89%e8%a3%85zsh/